从5.2升级Laravel 5.3的问题

时间:2018-05-08 08:22:21

标签: laravel laravel-5.3 laravel-upgrade

从5.2升级Laravel 5.3时我遇到了问题。

发生以下错误

 ReflectionException: Class does not exist in /MYPROJECT/vendor/laravel/framework/src/Illuminate/Container/Container.php:749

[2018-05-08 07:14:18] production.ERROR: ReflectionException: Class  does not exist in /opt/lampp/htdocs/MYPROJ/vendor/laravel/framework/src/Illuminate/Container/Container.php:749
Stack trace:
#0 /opt/lampp/htdocs/MYPROJ/vendor/laravel/framework/src/Illuminate/Container/Container.php(749): ReflectionClass->__construct('')
#1 /opt/lampp/htdocs/MYPROJ/vendor/laravel/framework/src/Illuminate/Container/Container.php(644): Illuminate\Container\Container->build('', Array)
#2 /opt/lampp/htdocs/MYPROJ/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(709): Illuminate\Container\Container->make('', Array)
#3 /opt/lampp/htdocs/MYPROJ/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(127): Illuminate\Foundation\Application->make('')
#4 /opt/lampp/htdocs/MYPROJ/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(33): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#5 /opt/lampp/htdocs/MYPROJ/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(104): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#6 /opt/lampp/htdocs/MYPROJ/vendor/laravel/framework/src/Illuminate/Routing/Router.php(655): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#7 /opt/lampp/htdocs/MYPROJ/vendor/laravel/framework/src/Illuminate/Routing/Router.php(629): Illuminate\Routing\Router->runRouteWithinStack(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request))
#8 /opt/lampp/htdocs/MYPROJ/vendor/laravel/framework/src/Illuminate/Routing/Router.php(607): Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request))
#9 /opt/lampp/htdocs/MYPROJ/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(268): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request))
#10 /opt/lampp/htdocs/MYPROJ/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http\{closure}(Object(Illuminate\Http\Request))
#11 /opt/lampp/htdocs/MYPROJ/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php(65): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#12 /opt/lampp/htdocs/MYPROJ/app/Http/Middleware/VerifyCsrfToken.php(26): Illuminate\Foundation\Http\Middleware\VerifyCsrfToken->handle(Object(Illuminate\Http\Request), Object(Closure))
#13 /opt/lampp/htdocs/MYPROJ/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(137): App\Http\Middleware\VerifyCsrfToken->handle(Object(Illuminate\Http\Request), Object(Closure))
#14 /opt/lampp/htdocs/MYPROJ/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(33): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#15 /opt/lampp/htdocs/MYPROJ/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#16 /opt/lampp/htdocs/MYPROJ/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(137): Illuminate\View\Middleware\ShareErrorsFromSession->handle(Object(Illuminate\Http\Request), Object(Closure))
#17 /opt/lampp/htdocs/MYPROJ/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(33): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#18 /opt/lampp/htdocs/MYPROJ/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(64): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#19 /opt/lampp/htdocs/MYPROJ/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(137): Illuminate\Session\Middleware\StartSession->handle(Object(Illuminate\Http\Request), Object(Closure))
#20 /opt/lampp/htdocs/MYPROJ/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(33): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#21 /opt/lampp/htdocs/MYPROJ/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php(37): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#22 /opt/lampp/htdocs/MYPROJ/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(137): Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse->handle(Object(Illuminate\Http\Request), Object(Closure))
#23 /opt/lampp/htdocs/MYPROJ/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(33): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#24 /opt/lampp/htdocs/MYPROJ/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(59): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#25 /opt/lampp/htdocs/MYPROJ/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(137): Illuminate\Cookie\Middleware\EncryptCookies->handle(Object(Illuminate\Http\Request), Object(Closure))
#26 /opt/lampp/htdocs/MYPROJ/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(33): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))

任何帮助将不胜感激。提前致谢

1 个答案:

答案 0 :(得分:0)

感谢您的努力,但我发现了有关给定错误的问题。这是由于RouteSeriveProvider.php文件中的中间件值。我错误地将其值设置为空白,并且找不到任何中间件,因此会产生上述错误。

mapWebRoutes 中的

app / Providers / RouteServiceProvider.php 文件我确实将中间件值设置为空白。如果您不想提供任何中间件,请删除整个中间件行。