-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Description
Package
filament/filament
Package Version
v4.0.0
Laravel Version
v12.0.0
Livewire Version
No response
PHP Version
8.4
Problem description
When attempting to save nested relationships, for example, Order->DeliveryAddress->Contact you either get validation errors on the Contact's inputs, if you mutate the data for validation then the data does not get inserted for Contact.
Expected behavior
In General I am trying to achieve a form for OrderResource and on the form I am attempting to create an Order, DeliveryAddress (belongsTo relation on Order), and a Contact (belongsTo relation on Address). So in other words I want to be able to nested relationship on a single form.
Steps to reproduce
Create a resource with a form that looks something like this:
class OrderForm { public static function configure(Schema $schema): Schema { return $schema ->components([ TextInput::make('order_number')->required(), Fieldset::make('Delivery Address') ->relationship('deliveryAddress') ->columnSpanFull() ->schema([ TextInput::make('street_address') ->columnSpanFull() ->required(), Group::make([ TextInput::make('name') ->label('Contact Name') ->required() ])->relationship('contact') ]) ]); } }
Reproduction repository (issue will be closed if this is not valid)
https://github.com/stian-scholtz-snappi/filament_nested_relation_demo
Relevant log output
Metadata
Metadata
Assignees
Labels
Type
Projects
Status