Home » Php » php – Routed feature module vs Routing feature module?

php – Routed feature module vs Routing feature module?

Posted by: admin February 25, 2020 Leave a comment


Hope evrything is fine.

I have laravel project.

Here is the api.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'}();

and here is the web.php

Route::get('/', function () {
   return view('welcome');

Route::get('/stores', function() {
    return App::make('App\Http\Controllers\UserController')->{'show'}();

However evryrequest that I put in the url, it always redricet to index.php ?

How to&Answers: