2017-04-23 155 views
-2

laravel中的奇怪錯誤?它隨機發生,沒有我編輯任何東西。 使用Laravel 5.4Laravel - 致命錯誤:未捕獲ReflectionException:類會話不存在

Fatal error: Uncaught ReflectionException: Class session does not exist in C:\web\vendor\laravel\framework\src\Illuminate\Container\Container.php:719 Stack trace: #0 C:\web\vendor\laravel\framework\src\Illuminate\Container\Container.php(719): ReflectionClass->__construct('session') #1 C:\web\vendor\laravel\framework\src\Illuminate\Container\Container.php(598): Illuminate\Container\Container->build('session') #2 C:\web\vendor\laravel\framework\src\Illuminate\Container\Container.php(567): Illuminate\Container\Container->resolve('session') #3 C:\web\vendor\laravel\framework\src\Illuminate\Foundation\Application.php(708): Illuminate\Container\Container->make('session') #4 C:\web\vendor\laravel\framework\src\Illuminate\Foundation\helpers.php(10 in C:\web\vendor\laravel\framework\src\Illuminate\Container\Container.php on line 719

+6

[我怎麼問一個好問題?](http://stackoverflow.com/help/how-to-ask) – hassan

+0

我們在編程的時候沒有奇怪的錯誤。閱讀@hassan提供的內容並澄清你所問的內容。 – Masoud

回答

-1

沒有session類Laravel,它的Session門面:

Session::get('key'); 

此外,還有一個全球性的幫手session

session('key'); 
+0

請解釋downvote。 –

相關問題