When accessing the login page of my laravel application I get a Undefined variable: errors (View: D:\PhpstormProjects\laravel\resources\views\login.blade.php)
error.
According to http://laravel.com/docs/master/validation#error-messages-and-views, $errors should always automatically be set:
So, it is important to note that an $errors variable will always be available in all of your views, on every request, allowing you to conveniently assume the $errors variable is always defined and can be safely used.
This is the blade file:
@extends('layouts.master')
@section('main')
<div id="loginwrapper">
<h2>Please authenticate</h2>
@if ($errors->has())
<div id="error">
{{ $errors->first() }}
</div>
@endif
{!! Form::open(['id' => 'loginform', 'name' => 'loginform']) !!}
... Form stuff ...
{!! Form::close() !!}
</div>
@stop
The view is being generated by a simple View::make('login');
I am using the laravel 5.0 development version.
Does anyone know the reason for this?
This was an error in the framework, just fixed today: https://github.com/laravel/laravel/commit/a9bddfc0e0573aa2b6d9d553126e9bf0af064e7b
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With