Support the ongoing development of Laravel.io →
Configuration Requests
Last updated 2 years ago.
0

Have u set your route to Named route ?

Last updated 2 years ago.
0

Yes, you can see the Problem in my Video

Last updated 2 years ago.
0

Has no one an idea?

Last updated 2 years ago.
0

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.

Last updated 2 years ago.
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.