I am trying to learn Laveral 5.2 and have the following in my routes.php:
Route::group(['middleware' => ['web'] ], function() {
Route::get('/', function () {
return view('welcome'); });
Route::post('/signup', [ 'uses' =>'UserController@postSignUp',
'as' => 'signup']);
Route::post('/signin', [ 'uses' => 'UserController@postSignIn',
'as' => 'signin']);
Route::get('/dashboard',['uses' =>'UserController@getDashboard',
'as' => 'dashboard' ]);
});
In my Controller I have some validation:
$this->validate( $request, [
'email' => 'required|email|unique:users',
'first_name' =>'required|max:120',
'password' => 'required|min:4'
]);
and in my logon screen I have the following:
@if (count($errors) > 0 )
<div class="row">
<div class="col-md-12">
<ul>
@foreach($errors->all() as $error)
<li>{{ $error }}</li>
@endforeach
</ul>
</div>
</div>
The error array seems to always be empty.