I have temporary problem with my project. I am creating a School Management System in Laravel. I have also implemented “spatie/laravel-permission”.
I have some roles: Student, Teacher, Parent, Headmaster etc.
I have some permissions: Add Grade / Edit Grade / Add Absence etc.
Everything works, yep. But the problem is that every student should be assigned to a class (I mean a class in school). How can I edit “spatie/laravel-permission” to implement what I want: if authenticated user is a student he should have also a class, and then type something like:
$thirdClass = User::role('student')->withClass('thirdClass')->get();
to get all users of this class?
I hope you understand what I mean, because my english is not so good as I think propably. I will appreciate every advice how to do it. Have a nice day!