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

You could try this, just a hunch, as it is the getIndex function that i responsible for returning the final value.

public function getIndex()
{
    $auth_return = $this->authorise('members.view');
    return $auth_return;
}

protected function authorise($permission)
{
    ....
    ....
    // If not authorised
   return redirect('/');
}
Last updated 8 years ago.
0

@haxzorer - Thanks for the reply. The issue is I want to return only if the user is not authorised, otherwise the index method will execute normally.

0
public function getIndex()
{
    $auth_return = $this->authorise('members.view');
    if(!$auth_return){    
        redirect('/');
    }
}

protected function authorise($permission)
{
    ....
    // if authorized
    return true;
    ....
    // If not authorised
   return false;
}
Last updated 8 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.