Gabriel Machado
Gabriel Machado

Reputation: 13

Call to undefined method Illuminate\Support\Facades\Auth::user()

I updated my project Laravel version from 5.1 to 5.7 and found the error:

"Call to undefined method Illuminate\Support\Facades\Auth::user()"

And in the same error screen:

"A facade root has not been set."

I don't know what's wrong. Anyone can help me?

Upvotes: 0

Views: 8804

Answers (1)

fonini
fonini

Reputation: 3341

Add in the `config/app.php' file:

Provider

'providers' => [

        /*
         * Laravel Framework Service Providers...
         */
        Illuminate\Auth\AuthServiceProvider::class,

Facade

'aliases' => [
        'Auth' => Illuminate\Support\Facades\Auth::class,

Upvotes: 2

Related Questions