© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
3 replies
Fossil

On/off toggle based on relationship? (Spatie/Laravel Permission)

I have this toggle to on/off certain permissions on the Edit User resource. How do I make that work with permissions stored in another table using Laravel Permission by Spatie?

Toggle::make('testPermission')->label('Test');
Toggle::make('testPermission')->label('Test');


Basically a name in the permissions table could be
'view this'
'view this'
with
id = 9
id = 9
for example. I need t check if it exists for this userID and turn the toggle on/off based on that.

If exists and I turn off the toggle it should delete and vice versa.
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Dynamic toggle columns based on relationship
FilamentFFilament / ❓┊help
5mo ago
Advise for spatie/laravel-permission "setPermissionsTeamId()"
FilamentFFilament / ❓┊help
3y ago
Spatie laravel-translatable
FilamentFFilament / ❓┊help
15mo ago
Spatie Translatable with spatie laravel settings
FilamentFFilament / ❓┊help
15mo ago