Answer the question
In order to leave comments, you need to log in
How to make readable url for api (laravel)?
I'm writing a small, public api that takes a few parameters and returns a response. Also there was a question about url. Based on the article , the url should look like this: GET /dogs?color=red&state=running&location=park
But, I did not find examples of how to do it in laravel (neither in the docks, nor in blogs).
Right now, my working version looks like this: GET /api/v1/dogs/dogs=labrador
and routes.php
Route::group(['prefix' => 'api/v1/dogs'], function()
{
Route::get('/dogs={dogs}', '[email protected]');
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question