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



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2HGN7I1
via IFTTT

Aucun commentaire:

Enregistrer un commentaire