Tray2
1 month ago
170
2
Laravel

Update to Laravel 8 breaks login

Posted 1 month ago by Tray2

A couple of weeks ago when Laravel 8 was released I upgraded my project and spent hours on fixing tests and factories and got my so far 400+ tests to green.

Since I've been developing this for a while I have used both the old make:auth and the laravel/ui make:auth to handle the stuff needed for all authentication stuff.

So after I moved all the models to the new Model directory all with passing tests, I wanted to test some stuff manually to see what I would need to do next.

And to my suprise I can't log in!! It throws a nasty error at me that App\User can't be found and I'm like of course not and checks my User model to make sure I have the correct namespace which I do.

Class '\App\User' not found 

This seems to be the culprit

Illuminate\Auth\EloquentUserProvider::createModel
vendor/laravel/framework/src/Illuminate/Auth/EloquentUserProvider.php:183

in the method createModel

public function createModel()
{
	$class = '\'.ltrim($this->model, '\');

	return new $class; //line 183
}

Now does anyone have a tip on how to get this to work without making a cusom update to the EloquentUserProvider file?

I rather not start from scratch and spend several hours on copy pasting the code into a new project.

Please sign in or create an account to participate in this conversation.