Action on a resource that creates another resource?
Hello !! Is it possible to create an action on a resource that creates another resource?
For example, I have the invoice resorces page ,
I want to add a button that passes the invoice data to the resource Order page + some custom data.
For now the only thing I could achieve is a redirect action to create a new order
->action(fn() => redirect()->route('filament.admin.resources.orders.create')),
tnxx !!
For example, I have the invoice resorces page ,
I want to add a button that passes the invoice data to the resource Order page + some custom data.
For now the only thing I could achieve is a redirect action to create a new order
->action(fn() => redirect()->route('filament.admin.resources.orders.create')),
tnxx !!

Solution
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)
);
})
->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)
);
})