NoxyArg
Repeater Duplicate queries when adding new item
Thanks for the answer, I didn't know the existence of eager loading, I looked at the Laravel documents but I don't understand how to apply it in this case, could you give me an example?, thx !
6 replies
Action form how send data ?
Tnx for the reply ! ,In this case don't have relationship, but there is no problem with that, the problem is that it would not be passing the selected id, it only gives me the position of an array of the ids that are to be selected, I don't see what I'm doing doing wrong :S
11 replies
Action on a resource that creates another resource?
I achieve what I wanted, directly inserting the data in the DB
->action(function($record) {
DB::table('orders')->insert(
array('client_id' => $record->client_id, 'obra' => 'TEST', 'description' => $record->invoice_number, 'article_id' => 2, 'created_by' => auth()->user()->id)
);
})
6 replies
Action on a resource that creates another resource?
In the InvoiceResource i create a action
Tables\Actions\Action::make('OrderCreate')
->action(fn ($record) => redirect()->route('filament.admin.resources.orders.create',['invoice_number' => $record->invoice_number, 'client_id' => $record->client_id,'obra' => $record->obra]))
And in the OrderResource
Forms\Components\TextInput::make('obra')
->default(function(Request $request) {
return $request->input('invoice_number');
})
With this I fill the field
6 replies