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('/');
}
@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.
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;
}
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community