Auth::user() returns null

后端 未结 6 1486
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-03 04:47

I use Laravel 5.2 and have a problem with middleware. There is the code in the routes.php


    use Illuminate\\Contracts\\Auth\\Access\\Gate;


    Route::group([         


        
6条回答
  •  南方客
    南方客 (楼主)
    2020-12-03 05:08

    I had the same problem because i did not set the table name.

    /**
     * The table associated with the model.
     *
     * @var string
     */
    protected $table = 'users';
    

提交回复
热议问题