Sending data to controller
Can we Send the form data of a resource to a controller
2 Replies
yes
For Creation read this:- https://filamentphp.com/docs/3.x/panels/resources/creating-records
For Update/edit read this:- https://filamentphp.com/docs/3.x/panels/resources/editing-records
i am send the data to a controller but it is not working am i missing something
Actions\Action::make('PanelInvoice')->form([
TextInput::make('companyname')
->default('heelo')
->label('Company Name'),
DatePicker::make('from')->default('NULL'),
DatePicker::make('to')->default('NULL'),
])->url(function (Get $get)
{
$data=$get('companyname'); dd($data); return route('panel-bill',$data); }, shouldOpenInNewTab: true) , Error: App\Filament\Resources\BillResource\Pages\ListBills::App\Filament\Resources\BillResource\Pages{closure}(): Argument #1 ($data) must be of type Filament\Forms\Get, array given, @Oumuamua
$data=$get('companyname'); dd($data); return route('panel-bill',$data); }, shouldOpenInNewTab: true) , Error: App\Filament\Resources\BillResource\Pages\ListBills::App\Filament\Resources\BillResource\Pages{closure}(): Argument #1 ($data) must be of type Filament\Forms\Get, array given, @Oumuamua