Could you please help me and explaing the logic in the three tiny methods.

In the “authorizeRoles($roles)” method, instead of throwing an exception you can change the line:

abort(401, 'This action is unauthorized.');


return redirect(‘/welcome’)->with('status', 'Unauthorized!');

or even:

return false; // then perform the redirect from the Controller..
One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.