I am currently working on a Laravel project using filamentPHP. However I cannot find a way to delete the create functionality for a specific resource.
Considering there is a resource named Customer, in the view page, I would like to remove the new customer button located at the top of the list. Is there any way to do that?
3
Answers
A Laravel specific solution is to create a new policy, and override the create() function to return false, like the following:
Note: Do not forget to assign the required model to this new policy in /Providers/AuthServiceProvider.php.
You can remove it by override canCreate() and return it as false.
I’m using filament v2.16.66 with Laravel 9.19.
What works for me in order to remove create button in certain lists, is adding the following function in eg:
AppFilamentResourcesCustomerResource