Laravel

Class ‘App\Http\Controllers\session’ not found

Class ‘App\Http\Controllers\session’ not found

 

When we are using laravel 4, There we will not get any issue when using with the session. When you start to work with laravel 5, there will be an slidely changes in structure and namespace usages.

How to install Laravel 5 :

To install Laravel guide check here.

How to find laravel 5 is enabled on your framework :

If you start seeing Illuminate\Session\TokenMismatchException show up–likely in your logs–this is because, by default, Laravel 5 has CSRF protection enabled on all routes. You can remove the CSRF protection Middleware from the $middleware stack in App\Http\Kernel and move it to the $routeMiddleware stack as an optional key, or you can adjust all of your forms–even those in AJAX–to ensure they all use CSRF.

Below are my error code how looks like :



 My Error :

ContextErrorException in BaseController.php line 22: Runtime Notice: Non-static method Symfony\Component\HttpFoundation\Session\Session::has() should not be called statically, assuming $this from incompatible context

How to resolve Class ‘App\Http\Controllers\session’ not found:

Thats it Now your code works well.

Class 'App\Http\Controllers\session' not found

If you like this article don’t forget to share and comment.