Not saving the data to the database
Hi Guys,
How about not saving the data to the Filament database when we hit the save button?
My case i want save data to API not DB Thanks
3 Replies
By the way you posted, it suggests you're using a resource to load/display data from "some source". Filament normally saves back to the same Eloquent-compatible source it loads/reads from.
So, are you loading that API data via Sushi instead of DB? Or how are you getting it to read the data?
Hi, Yes I am loading that API data via Sushi not from DB
You can determine the process yourself when creating and editing the model. These two excerpts should help you.
https://filamentphp.com/docs/3.x/panels/resources/editing-records#customizing-the-saving-process
https://filamentphp.com/docs/3.x/panels/resources/creating-records#customizing-the-creation-process
Don't forget that you also need to define predefined actions such as delete or bulkDelete yourself.
In tables, you won't be able to use the editable columns without adjustments. Here, you will need to customize the updateState() method in the columns for yourself.
I think, given the amount of customization, it makes sense to create a small package where you define all the classes that need customization and then use them in your resources or components. Making all the adjustments in the pages or resources would lead to a significant increase in effort and poorly maintainable code (depending on how many models you have).