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.
I figured it out;
if ($hasPermissions != true) { redirect()->to('/admin/error')->send(); }
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community