tighten / nova-package-development

A forum for talking about the process of Nova Package Development
52 stars 2 forks source link

Nova Create Child Relationship Package #29

Closed julianpoma closed 5 years ago

julianpoma commented 6 years ago

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

cerelli commented 6 years ago

Related to #9

julianpoma commented 6 years ago

@dillingham explain how?

cerelli commented 6 years ago

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

screenshot_20180910_154443

julianpoma commented 6 years ago

@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

ovvessem commented 6 years ago

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

voidgraphics commented 6 years ago

Yessssssssss we need this

dillingham commented 5 years ago

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

dineshbabu03 commented 5 years ago

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