邮递员的testo给我一个错误时,我在拉拉维尔(Laravel)测试护照时遇到问题。
"message": "",
"exception": "Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException",
"file": "/data/www/vendor/laravel/framework/src/Illuminate/Routing/RouteCollection.php",
"line": 179,
routes / api.php
Route::group([
'prefix' => 'api',
'middleware' => ['auth.api']
], function () {
Route::post('details', 'API\UserController@details');
});
UserController.php
public function details()
{
dd("Ijdsijds");
$user = Auth::user();
return response()->json(['success' => $user], $this->successStatus);
}
kernel.php
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',
'cors' => [
\Barryvdh\Cors\HandleCors::class,
]
],
];
VerifyCRFSToken.php
protected $except = [
//'authenticate'
'/api/*'
];
我要去哪里错了?路线列在路线:列表中
答案 0 :(得分:0)