Laravel: v5.7.28
Voyager: v1.2.0
PHP: 7.2
Database: MySQL 8.0
Я настроил панель администратора Voyager на своей электронной коммерции Laravel.Когда я пытаюсь войти в систему, я вижу ошибку:
(1/1) Метод BadMethodCallException Illuminate \ Http \ Request :: validate не существует.
Стек:
--
in Macroable.php line 100
at Request->__call('validate', array(array('email' => 'required\|string', 'password' => 'required\|string')))in AuthenticatesUsers.php line 68
at VoyagerAuthController->validateLogin(object(Request))in VoyagerAuthController.php line 24
at VoyagerAuthController->postLogin(object(Request))
at call_user_func_array(array(object(VoyagerAuthController), 'postLogin'), array(object(Request)))in Controller.php line 54
at Controller->callAction('postLogin', array(object(Request)))in ControllerDispatcher.php line 45
at ControllerDispatcher->dispatch(object(Route), object(VoyagerAuthController), 'postLogin')in Route.php line 219
at Route->runController()in Route.php line 176
at Route->run()in Router.php line 682
at Router->Illuminate\Routing\{closure}(object(Request))in Pipeline.php line 30
at Pipeline->Illuminate\Routing\{closure}(object(Request))in SubstituteBindings.php line 41
at SubstituteBindings->handle(object(Request), object(Closure))in Pipeline.php line 163
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request))in VerifyCsrfToken.php line 75
at VerifyCsrfToken->handle(object(Request), object(Closure))in Pipeline.php line 163
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request))in ShareErrorsFromSession.php line 49
at ShareErrorsFromSession->handle(object(Request), object(Closure))in Pipeline.php line 163
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request))in StartSession.php line 63
at StartSession->handle(object(Request), object(Closure))in Pipeline.php line 163
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request))in AddQueuedCookiesToResponse.php line 37
at AddQueuedCookiesToResponse->handle(object(Request), object(Closure))in Pipeline.php line 163
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request))in EncryptCookies.php line 66
at EncryptCookies->handle(object(Request), object(Closure))in Pipeline.php line 163
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request))in Pipeline.php line 104
at Pipeline->then(object(Closure))in Router.php line 684
at Router->runRouteWithinStack(object(Route), object(Request))in Router.php line 659
at Router->runRoute(object(Request), object(Route))in Router.php line 625
at Router->dispatchToRoute(object(Request))in Router.php line 614
at Router->dispatch(object(Request))in Kernel.php line 176
at Kernel->Illuminate\Foundation\Http\{closure}(object(Request))in Pipeline.php line 30
at Pipeline->Illuminate\Routing\{closure}(object(Request))in InjectDebugbar.php line 65
at InjectDebugbar->handle(object(Request), object(Closure))in Pipeline.php line 163
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request))in CheckForMaintenanceMode.php line 62
at CheckForMaintenanceMode->handle(object(Request), object(Closure))in Pipeline.php line 163
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request))in Pipeline.php line 104
at Pipeline->then(object(Closure))in Kernel.php line 151
at Kernel->sendRequestThroughRouter(object(Request))in Kernel.php line 116
at Kernel->handle(object(Request))in index.php line 55
Ошибка в Laravel https://github.com/laravel/framework/blob/6.x/src/Illuminate/Foundation/Auth/AuthenticatesUsers.php#L67
protected function validateLogin(Request $request)
{
$request->validate([
$this->username() => 'required|string',
'password' => 'required|string',
]);
}
Я проверяю документацию https://laravel.com/docs/5.7/validation и ее правильный код.Пожалуйста, помогите, почему это не работает?