Undefined variable: errors in Laravel

You should make sure that in app/Http/Kernel.php in middlewareGroups property for web you have: \Illuminate\View\Middleware\ShareErrorsFromSession::class, in this array. Compare this with https://github.com/laravel/laravel/blob/master/app/Http/Kernel.php EDIT It seems you need to add ‘middleware’ => ‘web’ for route you are using or put \Illuminate\View\Middleware\ShareErrorsFromSession::class, into $middleware property array or Inside of the routes.php file try to create your routes … Read more

Uncaught ReflectionException: Class log does not exist Laravel 5.2

Okay, after many hours of digging, the solution for my problem has been found. The reason why I say my problem is because the Exception is very mis-leading. Uncaught ReflectionException: Class log does not exist This exception simply means Laravel tried to log an error but couldn’t instantiate Laravel’s Log class. This is not due … Read more

TokenMismatchException in VerifyCsrfToken.php Line 67

I’m assuming you added $this->middleware(‘auth’); inside the constructor of your controller to get the authentication working. In your login/register forms, if you are using {!! Form::someElement !!}, add the following line at the top as well: {!! csrf_field() !!} Or if you are using input tags inside your forms, just add the following line after … Read more

How to protect image from public view in Laravel 5?

It is possible to protect images from public view in Laravel 5.x folder. Create images folder under storage folder (I have chosen storage folder because it has write permission already that I can use when I upload images to it) in Laravel like storage/app/images. Move the images you want to protect from public folder to … Read more

Laravel 5.2 Validation Error not appearing in blade

Try to remove web middleware if you’re using 5.2.27 or higher. The thing is now Laravel automatically applies web middleware to all routes inside routes.php and if you’re trying to add it manually you can get errors. app/Providers/RouteServiceProvider.php of the 5.2.27 version now adds web middleware to all routes inside routes.php: protected function mapWebRoutes(Router $router) … Read more