Support the ongoing development of →
Authentication Authorization
Last updated by @tvbeek 1 year ago.

Hello @damogallagher

This is a big class :)

Do you upgrade in steps (so 5.2 -> 5.3 -> 5.4 >>>> 9) or are you going directly from 5.2 to 9? My personal experience is that it is more doable to do it in steps.

Do you get any errors for this class?

ps. I have updated your post to get the code more readable.


Hi @tvbeek

Thank you for getting back to me. Yes I went back through the notes and have come to the following.

Replace the following import use Illuminate\Foundation\Auth\AuthenticatesAndRegistersUsers; with use Illuminate\Foundation\Auth\AuthenticatesUsers;

My errors are narrowed to the following lines now. I get an error that AuthController::getCredentials does not exist.

For this line and other lines that refer to the guards, do you happen to know what the equivalent in Laravel 9 would be?

$credentials = $this->getCredentials($request);
            if (Auth::guard('admin')->attempt($credentials)) {

                // Check valid admin user and record last login date
                $auth = Auth::guard('admin')->user();

                $urls = AdminPrivilege::select('url')->where('group', $auth->group)->get();

                $result = array();
                foreach($urls as $v){
                    array_push($result, $v->url);

                // Put group, url info into Session for Admin Privilege
                    'group'     => $auth->group,
                    'url'       => $result


Or do you happen to any links to sample applications that have authentication setup for different user types? (e.g. standard users, admins etc)

dbdxwb liked this reply


I see that the function exist in Laravel 5.2:

I think the most easy way is to recreate the (working of) that function in your controller.


Sign in to participate in this thread!


Your banner here too?


We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 - All rights reserved.