#How to prevent filament shield overwriting custom policies?

10 messages · Page 1 of 1 (latest)

glacial imp
#

Hi, I'm using filament 4 in my app and I have to config some custom policies after filament shield generates all default policies, right now I have to do it manual after running php artisan shield:generate --all, wondering if there is a way to set it to use customized policy instead of default generated one and prevent it from overwriting?

foggy steepleBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution

zealous prism
#

You ran:

php artisan shield:generate --all --option=policies

To only generate the missing policies?

glacial imp
#

Oh i didn't know it has other options, will try it thank you

zealous prism
foggy steepleBOT
glacial imp
# zealous prism The documentation is great for this…

hi again, I tried that option in a new deploy but it only works if I do --all option once and then add custom policies and then do that option you mentioned for next times. but when I try it at first deploy it doesn't generate default policies. is there any better way to persist custom policies and generate rest of default policies too?

glacial imp
#

main issue is resources that are in project but doesn't show in admin panels until I do php artisan shield:generate --all but this way I lose all custom policies

thin ermine
terse zinc
#

Run it for missing resources, like —resource=FooResource