Amy
Amy

Reputation: 163

dingo error while get method with parameter

$api->version('v1', ['middleware' => 'api.auth'], function($api){
    $api->get('auth/user', 'App\Http\Controllers\Api\ApiUserController@getAuthUser');

    $api->get('auth/getInfo', 'App\Http\Controllers\Api\ApiUserAppointmentController@getInfo');

    $api->get('auth/show/{id}', 'App\Http\Controllers\Api\ApiUserAppointmentController@show');

});

public function show($id)
   {
    echo $id;die;
}

Error

    "message": "404 Not Found",
    "status_code": 404,
    "debug": {
        "line": 161,
        "file": "C:\\xampp\\htdocs\\G2Project\\medcrip\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\RouteCollection.php",

I stuck when adding parameter in get method don't know why this is say not found. if i remove {id} from route it works fine but when i do add {id} that says to me not found.

Please advice thanks in advance

Upvotes: 1

Views: 77

Answers (1)

Alexey Mezenin
Alexey Mezenin

Reputation: 163748

To make the auth/show/{id} route work, you should use this URI:

/api/auth/show/53 

instead of this:

/api/auth/show/?id=53

Upvotes: 2

Related Questions