Integrating Custom Pages into Laravel Policies
I'm doing a project where I had to use the custom pages functionality, but with these pages I'm not getting the access permissions configured in app/Providers
4 Replies
I think you can safely do the check in the page's
mount()
method :
But is there any way to link Laravel Policy and Providers to perform all security control of pages in one place?
Possibly... If your custom page requires the same permission as another kind of resource, you could check for that instead (e.g.
->can('view_any_page')
)
Or using the resource class directly:
Okay, thanks a lot for the support.