Yes, you can see the Problem in my Video
How / where are you calling the check() method? If you want to be redirected, then you should return the redirect in your controller method i.e.:
<?php
use Modules\Users\Acl\Libs\ACL;
class MyController {
public function index()
{
// Check if ACL passes, if not, return the redirect
if (! $acl = $this->acl->check($rightName, $redirect))
{
// Return the ACL response
return $acl
}
// DO something
}
}
Edit: It might be better to throw an InsufficientPermissionsException in the check method, such that the ACL class is not responsible for handling responses. You can then catch that exception in your controller (or any other class) and respond accordingly.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community