jeudi 28 juillet 2016

Managing a relationship between a table and another relationship in Laravel 5

I'm having this problem in Laravel. I have a table grants and a table places, then I have the relationship grant_place. Then I have admins, each admin has places (0-N), and each admin can have all the place grants or less, so I want to make a admin_place_grant table so that I can assure myself that the admin is never gonna have more grants in that place than the place.

So for example: The place 1 has the grant to send emails, but doesn't have the grant to enter to the dashboard. I don't want to have admin A that controls place 1, having both of the grants. That's why I thought about that solution.

The problem is that I don't know how to manage this on Laravel, because I have the Model: Admin, Place, Grant, but how can I get the place_grant each admin has?.

Thank you for your help, I hope everyone understood my problem, if not, ask me and I'll try to explain it better



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire