Laravel 6.0 php artisan route:list returns “Target class [App\Http\Controllers\SessionsController] does not exist.”

后端 未结 17 2188
無奈伤痛
無奈伤痛 2021-02-05 10:36

I am using Laravel 6.0 and I try to list all my routes with artisan route:list, but it fails and returns:

Illuminate\\Contracts\\Container\\

17条回答
  •  忘掉有多难
    2021-02-05 11:12

    I had this problem while leaving an empty middleware class in my middleware groups by mistake :

        /**
         * The application's route middleware groups.
         *
         * @var array
         */
        protected $middlewareGroups = [
            'web' => [
                Middleware\EncryptCookies::class,
                \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
                \Illuminate\Session\Middleware\StartSession::class,
                \Illuminate\View\Middleware\ShareErrorsFromSession::class,
                Middleware\VerifyCsrfToken::class,
                \Illuminate\Routing\Middleware\SubstituteBindings::class,
            ],
    
            'api' => [
                'throttle:100,1',
                'bindings',
                'localization',
                '' // Was empty by mistake
            ],
        ];
    

提交回复
热议问题