Support the ongoing development of Laravel.io →
Requests
Last updated 1 year ago.
0

you aren't returning anything

0

I know, I don't want to as it's the controllers constructor method that's calling in the userHasPermission method;

public function __construct() { AdminHelper::userHasPermission('user', 'view', true); }

The idea is the constructor method checks the user can access this controller, and if the user doesn't have permissions, the method should perform a redirect.

0

I figured it out;

if ($hasPermissions != true) { redirect()->to('/admin/error')->send(); }

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.