framework: [5.2] Undefined variable: errors
http://laravel.com/docs/master/validation
<!-- /resources/views/post/create.blade.php -->
<h1>Create Post</h1>
@if (count($errors) > 0)
<div class="alert alert-danger">
<ul>
@foreach ($errors->all() as $error)
<li>{{ $error }}</li>
@endforeach
</ul>
</div>
@endif
<!-- Create Post Form -->
ErrorException in 146820125ca4b230f9c1f73ff3a4495c08e4d193.php line 75:
Undefined variable: errors
(View: /Users/PheRum/Sites/laravel.local/resources/views/layouts/app.blade.php)
(View: /Users/PheRum/Sites/laravel.local/resources/views/layouts/app.blade.php)
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Comments: 19 (9 by maintainers)
After generating make:auth, I see Route::auth() was outside ‘web’ group. As Graham mentioned, once I put inside Route group ‘web’, the $errors msg is gone
ok
It DOES work. You MUST be on a page that’s loaded from inside the web middleware group.