希望一切都很好。
我有laravel项目。
这是api.php:
<?php
use Illuminate\Http\Request;
Route::middleware('auth:api')->get('/user', function (Request $request) {
return $request->user();
});
Route::middleware('cors:api')->get('/stores', function (Request $request, Response $response) {
return App::make('App\Http\Controllers\ApiData')->{'GetStores'}();
});
Route::middleware('cors:api')->post('/RegisterLocation', function (Request $request, Response $response) {
return App::make('App\Http\Controllers\ApiData')->{'RegisterLocation'}();
});
Route::middleware('cors:api')->post('/SearchPartner', function (Request $request, Response $response) {
return App::make('App\Http\Controllers\ApiData')->{'SearchPartner'}();
});
这是web.php
<?php
Route::get('/', function () {
return view('welcome');
});
Route::get('/stores', function() {
return App::make('App\Http\Controllers\UserController')->{'show'}();
});
无论我将evryrequest放在url中,它始终会重新存储到index.php吗?