filament-blog
filament-blog copied to clipboard
How to add permissions and roles to filament-blog with Shield plugin
Hello everyone, I have seen somewhere people struggled to add permissions and roles for this plugin as I did also... So I found a way how to add to filament blog plugin permissions and roles using also widely popular Shield plugin, it might not be convenient way but it works for me.
- Copy resources provided from filament-blog ( Me personally created a command to copy from vendor all resources )
- When copied run php artisan shield:generate --all and it will generate policies with coresponding resources from filament-blog
- Most important is to add Gate Policies if u use Laravel 11^ its in AppServiceProvider.php
- Optionaly u can add also HasShieldPermissions interface to resources.
No working man, I tried like above.
No working man, I tried like above.
Well are you sure u setup everything correctly because I've just tested it one more time on new project and it works. I will publish repo publicly so maybe check if u missed something.