且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Symfony\Component\HttpKernel\Exception\NotFoundHttpException - Laravel API

更新时间:2021-10-16 22:14:56

由于使用了 api.php 文件,所以可以减少使用的组

Since you are using the file api.php, you can reduce the group you're using

(你也不需要使用)

<?php

Route::group(['prefix' => 'auth'], function ($router) {
    Route::post('upload', 'FileController@upload');
});

正如你在 app/Providers/RouteServiceProvider.php@40 中看到的,它已经定义了

As you can see in app/Providers/RouteServiceProvider.php@40, it is already defined

// protected $namespace = 'App\\Http\\Controllers';
//...
        $this->routes(function () {
            Route::prefix('api')
                ->middleware('api')
                ->namespace($this->namespace)
                ->group(base_path('routes/api.php'));

您是否将请求作为 POST 运行?

Did you run the request as POST ?