skip to Main Content

I don’t know why, but I continue to receive 404 when I call my endpoints on postman
my routes:

Route::get('getlist', 'AppHttpControllersApiController@getList');
Route::post('login', 'AppHttpControllersAuthController@login');
Route::post('/register','AppHttpControllersAuthController@register');

I don’t know if it’s relevant but I’ve done changes in my auth.php also

    'guards' => [
        'web' => [
            'driver' => 'session',
            'provider' => 'users',
        ],
        'guards' => [
            'api' => [
                'driver' => 'jwt',
                'provider' => 'users',
            ],
        ],        
    ],

Obviously I’ve started my application with php artisan serve

2

Answers


  1. 'guards' => [
        'web' => [
            'driver' => 'session',
            'provider' => 'users',
        ],
        'api' => [
                'driver' => 'jwt',
                'provider' => 'users',
            ],
    ],
    

    Call endpoint from postman like this:

    your_app_base_url/api/getlist
    

    If you have any prefix like v1 etc:

     your_app_base_url/api/v1/getlist
    
    Login or Signup to reply.
  2. some problem may fixed by this command

    php artisan optimize

    and try to check your route list with

    php artisan route:list

    and make sure your route has shown

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search