Create hasOne in model
Hi i have set a user to haveOne application in the User model, How can i get filament to use the relationship so a user cannot create more than one application? Thanks
5 Replies
define it to both model and make a validation
Hi, can you elaborate on the make-validation? I have belongsTo and hasOne set up on both models,
I have added this to the application resource, and it hides the create button, but if I manually go to the create page it just says forbidden, is there a way to redirect back to list view and show a notification?
thanks
looks like you're trying to create a role base permission?
https://filamentphp.com/plugins/bezhansalleh-shield
Filament
Shield by Bezhan Salleh - Filament
The easiest and most intuitive way to add access management to your Filament Panel's Resources, Pages & Widgets through spatie/laravel-permission.
Thanks for the reply, is this the best way of setting up permissions? Will this sort out the manual create url access forbidden issue? Thanks mate
yeah, you can also watch this tutorial: https://youtu.be/iOzkpKZnnI0?feature=shared
Tony Xhepa
YouTube
Laravel Filament Shield Plugin - Role and Permission
Secure Your Laravel Filament Admin Panel with Roles & Permissions
This video dives into the Filament Shield plugin, the ultimate tool for managing roles and permissions in your Laravel Filament admin panel.
Key Features:
Effortless RBAC (Role-Based Access Control): Control user access to Resources, Pages, Widgets, and custom functionalities u...