lundi 30 janvier 2017

Laravel routing two optional one after another

First, I would gladly accept suggestions on that title, because I am not sure how to explain my issue in one row.

I have a route that looks like that

Route::get ('/i/{group?}/{name?}', 'Controller@index')->name('name');

Problem is when I go to /i//myname it throws a route exception.

I made both conditional because I have strict validations within the controller. I want to keep that structure, but what route should I make to make both optional variables work ?

Ex. When you open /i//myname to redirect you to the select group page, so as /i/group// or /i/group/



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

Aucun commentaire:

Enregistrer un commentaire