拉拉维尔护照路线 [登录] 未定义
2022-08-30 23:49:32
我使用Laravel护照进行授权
在 route api 中.php
Route::get('/todos', function(){
return 'hello';
})->middleware('auth:api');
但是当打开本地主机:8000 / api / todos时,我看到以下错误
InvalidArgumentException
Route [login] not defined.
* @return string
*
* @throws \InvalidArgumentException
*/
public function route($name, $parameters = [], $absolute = true)
{
if (! is_null($route = $this->routes->getByName($name))) {
return $this->toRoute($route, $parameters, $absolute);
}
throw new InvalidArgumentException("Route [{$name}] not defined.");
}
/**
* Get the URL for a given route instance.
*
* @param \Illuminate\Routing\Route $route
* @param mixed $parameters
* @param bool $absolute
* @return string
*
* @throws \Illuminate\Routing\Exceptions\UrlGenerationException
*/
protected function toRoute($route, $parameters, $absolute)
{
return $this->routeUrl()->to(
$route, $this->formatParameters($p
我想要如果用户未通过身份验证,请不要重定向到任何页面,只看到该页面