mardi 3 septembre 2019

How get lot of params from url but without (&)?

For now in Laravel i am testing url and in route i have

Route::group(['prefix' => 'game'], function (){ 
 Route::get('/location/{location?}/action/{action?}/screen/{screen?}','GameController@index')->name('game.index');
});

In controller when i wanna pass params i have to type

example.com/game/location/1/action/update/screen/main

if i wanna pass only location and screen i have an error cause in url second param should be action.

I can create url like

example.com/game/?location=1&screen=main

and controller $request->screen and location works fine. But is any way to not using & ? and do this like:

example.com/game/location/1/screen/main



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire