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?
Basically a name in the permissions table could be
If exists and I turn off the toggle it should delete and vice versa.
Basically a name in the permissions table could be
'view this' with 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.