Policy for Settings Plugin?
I tried creating a policy for the settings plugin, but it appears to have no effect. All other policies I have work as expected, except this one. This is how I generated the policy:
5 Replies
Filament
Getting started - Pages - Admin Panel - Filament
The elegant TALL stack admin panel for Laravel artisans.
Policies only work for Resources. For custom pages you need to use
mount()
and the method Leandro linkedI just implemented this code, which works to protect the page, but it appears to have caused a kink in the settings plugin. I can get to the settings page with the proper role, but it's no longer pulling up existing values from the database into the form. It writes the values to the database correctly, but going to the form after a successful save shows empty values in the form fields, yet the updated values are in the database. After uncommenting out the following code, it goes back to working correctly, except other users can get to it without this code:
You overwrote
mount()
without calling the parent method πThat solved the problem, thanks.