nova-package-development icon indicating copy to clipboard operation
nova-package-development copied to clipboard

Nova Create Child Relationship Package

Open julianpoma opened this issue 8 years ago • 8 comments

The idea of this package is to let you create a new resource and many "child dependent" ones, on a single action. For example, we may have an Invoice that consists on many Invoice Items.

** Invoice.php

public function items()
{
   return $this->hasMany(InvoiceItem::class);
}
** InvoiceItem.php

public function invoice()
{
   return $this->belongsTo(Invoice::class);
}

When creating a new Invoice, you should be able to add as many "items rows" as you want, and then save the corresponding data on in its own tables (invoices_table and invoice_items_table).

EDIT: This is a gif of what I am looking for. It doesn't have to have those fancy total_price calcs, nor support complex input types: just basic ones like strings, numbers or a boolean.

image

julianpoma avatar Sep 10 '18 13:09 julianpoma

Related to #9

cerelli avatar Sep 10 '18 13:09 cerelli

@dillingham explain how?

julianpoma avatar Sep 10 '18 13:09 julianpoma

??? In the same page? I want to create one page for spatie/laravel-permission.

screenshot_20180910_154443

cerelli avatar Sep 10 '18 13:09 cerelli

@dillingham I already know that, and that the reason why I am posting this here. It's a matter of improving the UX and do things quickly.

image

julianpoma avatar Sep 10 '18 13:09 julianpoma

Really like the idea of creating the parent and child in one page!

ovvessem avatar Oct 18 '18 22:10 ovvessem

Yessssssssss we need this

adrienleloup avatar Nov 09 '18 12:11 adrienleloup

https://novapackages.com/packages/yassi/nova-nested-form Would work for this purpose considering some style differences

dillingham avatar Dec 29 '18 17:12 dillingham

The idea of this package is to let you create a new resource and many "child dependent" ones, on a single action. For example, we may have an Invoice that consists on many Invoice Items.

** Invoice.php

public function items()
{
   return $this->hasMany(InvoiceItem::class);
}
** InvoiceItem.php

public function invoice()
{
   return $this->belongsTo(Invoice::class);
}

When creating a new Invoice, you should be able to add as many "items rows" as you want, and then save the corresponding data on in its own tables (invoices_table and invoice_items_table).

EDIT: This is a gif of what I am looking for. It doesn't have to have those fancy total_price calcs, nor support complex input types: just basic ones like strings, numbers or a boolean.

image

Hello Julian,

Could please explain me how to create the invoice form design like in the above. Thanks

dineshbabu03 avatar Jul 02 '19 07:07 dineshbabu03