Support the ongoing development of Laravel.io →
Authentication Security
Last updated 2 years ago.
0

I guess you have a Many-To-Many Relationship between "users" and "bookshelves": https://laravel.com/docs/5.2/eloquent-relationships#many-to-many

A user can have many bookshelves, but a bookshelv can also belong to many users. You basically have already expressed this relationship through your "bookshelf_access" table. This is your so called "pivot table".

Now you just need to setup your Eloquent Models as described in the documentation.

If you want different roles and permissions (for example only the creator of the bookshelf can edit the name etc.), you can have a look at different packages, for example:

https://cartalyst.com/manual/sentinel/2.0 https://github.com/Zizaco/entrust https://github.com/romanbican/roles https://github.com/kodeine/laravel-acl

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.