Laravel: v5.7.28
Voyager: v1.2.0
PHP: 7.2
Database: MySQL 8.0
我在我的Laravel电子商务上设置了Voyager管理面板。当我尝试登录时,我看到一个错误:
(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
拉拉维尔 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,它是正确的代码。请帮助,为什么它不起作用?
我没有正当的理由,但我在更新到5.6后遇到了同样的问题。使用
use Request;
而不是
use Illuminate\Http\Request;
这对我有用
你应该用$this-
或者,您可以使用Validator::做();方法并传入$请求作为第一个参数
我已经创建了一个视图来创建新的课程' create.blade.php '。我试图将这些数据存储在数据库中,但是我得到了以下错误: BadMethodCallException Method Illuminate\Http\Request::request 不存在。 我不确定是什么导致了这个错误,因为我已经在我的控制器中引用了请求名称空间。见下文; CoursesController.php; 创
从5.5.28升级到laravel 5.6.21后,我遇到了以下错误: 方法Illumbite\Http\Request::setTrustedHeaderName不存在。 日志中的更多信息: 拉雷维尔。错误:方法Illumbite\Http\Request::setTrustedHeaderName不存在。{“exception”:“[对象](BadMethodCallException(代码:
本文向大家介绍如果URL PHP中不存在http://,如何添加?,包括了如果URL PHP中不存在http://,如何添加?的使用技巧和注意事项,需要的朋友参考一下 在这里,我们设置了一个函数,该函数将“ http://添加到字符串。假设我们传递了以下值- 我们想要的输出是“ http://”,即实际链接- 为此,可以将点(。)表示法和条件匹配与preg_match()一起使用。 示例 输出结果
http-request 是 Android 网络框架,在小型的项目上性能表现最好。 使用: The http-request library is available from Maven Central. <dependency> <groupId>com.github.kevinsawicki</groupId> <artifactId>http-request</artifactId>
问题内容: 我有一个PHP 5.1.0网站(实际上是5.2.9,但它也必须在5.1.0+上运行)。 页面是动态生成的,但是许多页面大多数是静态的。静态是指内容不变,但是内容周围的“模板”会随着时间而改变。 我知道他们已经有几个缓存系统和PHP框架,但是我的主机没有安装APC或Memcached,并且我没有为该特定项目使用任何框架。 我希望页面被缓存(我认为默认情况下PHP“不允许”缓存)。到目前为
类App\Http\Controller\HomeController不存在 家庭控制器 web.php 一开始一个新的授权控制器出现,我把KG关了,去掉了