При отправке формы ....
@if (count($errors) > 0)
<div class="alert alert-danger">
<ul>
@foreach ($errors->all() as $error)
<li>{{ $error }}</li>
@endforeach
</ul>
</div>
@endif
<form method="post" action="/regcontractor" name="regcompany">
<input type="hidden" name="formOfOwnership" value="company">
<input type="hidden" name="_token" value="{{ csrf_token() }}">
<div class="panel panel-default company">
<table class="table">
<tr>
<td class="nameField">Email*</td>
<td class="field"><input class="form-control" type="text" name="email" value="{{ old('email') }}" required><small>Будет использоваться для входа</small></td>
</tr>
<tr>
<td class="nameField">Пароль*</td>
<td class="field"><input class="form-control" type="password" name="password" required></td>
</tr>
<tr>
<td class="nameField">Повторите пароль*</td>
<td class="field"><input class="form-control" type="password" name="reenterpassword" required></td>
</tr>
<tr>
<td></td>
<td>
<p><button type="submit" class="btn btn-default btn-lg"><span class="glyphicon glyphicon-ok"></span>  Регистрация</button></p></td>
</tr>
</table>
</div>
</form>
.... методом POST срабатывает роутер ....
Route::post('/regcontractor', "Contractor@registration");
... вызывающий контроллер ...
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Http\Requests;
use App\Http\Controllers\Controller;
use Validator;
class Contractor extends Controller
{
public function registration (Request $request)
{
$title="Регистрация";
if ($request->isMethod('post'))
{
$rules =
[
'email'=>'required|email',
'password'=>'required',
'reenterpassword'=>'required',
];
$this->validate($request, $rules);
return view('regcontractor',['title'=>$title]);
}
}
Файл \app\Http\Kernel.php
namespace App\Http;
use Illuminate\Foundation\Http\Kernel as HttpKernel;
class Kernel extends HttpKernel
{
/**
* The application's global HTTP middleware stack.
*
* These middleware are run during every request to your application.
*
* @var array
*/
protected $middleware = [
\Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode::class,
\Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
\App\Http\Middleware\TrimStrings::class,
\Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
\Illuminate\Session\Middleware\StartSession::class,
\Illuminate\View\Middleware\ShareErrorsFromSession::class
];
/**
* The application's route middleware groups.
*
* @var array
*/
protected $middlewareGroups = [
'web' => [
\App\Http\Middleware\EncryptCookies::class,
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
\Illuminate\Session\Middleware\StartSession::class,
// \Illuminate\Session\Middleware\AuthenticateSession::class,
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
\App\Http\Middleware\VerifyCsrfToken::class,
\Illuminate\Routing\Middleware\SubstituteBindings::class,
],
'api' => [
'throttle:60,1',
'bindings',
],
];
/**
* The application's route middleware.
*
* These middleware may be assigned to groups or used individually.
*
* @var array
*/
protected $routeMiddleware = [
'auth' => \Illuminate\Auth\Middleware\Authenticate::class,
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class,
'can' => \Illuminate\Auth\Middleware\Authorize::class,
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
];
}
В $middleware прописаны классы \Illuminate\Session\Middleware\StartSession::class, \Illuminate\View\Middleware\ShareErrorsFromSession::class
Но ошибки из $errors в виде не показываются, как и валидные значения, которые ввел пользователь ({{ old('имя поля') }}). В чем может быть проблема?