cartalyst / sentinel

A framework agnostic authentication & authorization system.
BSD 3-Clause "New" or "Revised" License
1.51k stars 238 forks source link

Extending Sentinel - Laravel module pattern #532

Open quentingosset opened 4 years ago

quentingosset commented 4 years ago

Hi, guys! I'm coming to you because I have a little problem I can't solve. To start, I develop my application as a module here are the 2 main modules that are the cause of my problem. -User -Vendor

Here is a brief explanation of my problem: When a seller registers on my site, he registers as a user, he can add items. When he adds an item, his id as well as the product id is inserted in a products_vendor table. From here my problem begins, I have created a products relationship that links my users with the products they own. Knowing that I develop in modules, I would like to allow the simple extension of certain functions such as "products()" so that when I call the Basic User module, it has the function when the module is activated. I have tested the following method: https://github.com/cartalyst/sentinel/wiki/Extending-Sentinel but this method replaces the User entity with the one provided and the one I provide has only my products() function.

Do you have an idea of how I can solve my problem?

Yours sincerely.