Using custom function in a form
I have a page where I have a form textarea, in the textarea I have all the ids divided by comma example: qIcTM8WXFjk,8X2kIfS6fb8
These ids are processed through a function of mine:
How can I tell Filamentphp to use this function to post data? Also, how do I add a button next to "New Video" in the header? In the documentation I find only references to how to add buttons in tables
Solution:Jump to solution
you can use hooks to process your data
https://filamentphp.com/docs/3.x/panels/resources/creating-records#lifecycle-hooks...
6 Replies
When you say you have a page, is this a custom page? Or a standard Filament create page?
Standard created by filament
any idea?
button on the header - you can add on your ListPage https://filamentphp.com/docs/3.x/panels/pages#header-actions
Solution
you can use hooks to process your data
https://filamentphp.com/docs/3.x/panels/resources/creating-records#lifecycle-hooks
In my case, should I create the beforeCreate() function in VideoResource? And how do I get the $request of the created form?
you can use beforeCreate, afterCreate... you can get the data using
$this->data
after create you can use $this->record
or getRecord()