Create Policies for each Auth Model (Multi Panels)
I have multi panels and I am trying to use Policies for the multi panels I have Admin Model and User Model
3 Replies
try and see if this works inside your Policy methods. I was planning to use this.
If you are trying to achieve different polices for different panels you can do something like this in AuthServiceProvider:
Suppose you have two panel providers, AdminPanelProvider and CustomerPanelProvider, To use this implementation, you should have Admin related Models in App\Models\Admin directory and Customer related models in App\Models\Customer directory.
Also, Admin related policies in App\Policies\Admin and Customer related policies in App\Policies\Customer directory. The directory name is based on Panel's id.
you can also just check what the user is inside each policy method