dimanche 29 novembre 2015

How to make a url with parameters? Laravel 5.1

I need to make a url with undetermined number of parameters. So I want to make search.

For example:

http://ift.tt/1jrEWA2?}

http://ift.tt/1XpFQja
http://ift.tt/1jrEXE4
http://ift.tt/1XpFSHD
test.com/breakfast

ingredients and eingredients are arrays.

ingredients - included in the recipe (ids) eingredients - excluded from the recipe (ids)

I have an idea:

Route::get('/recipes/{category?}/{country?}/{ingredients?}/{eingredients?}', 'RecipeController@index')
->where(['ingredients' => '^ingredients/[0-9\/]+$', 'eingredients' => '^eingredients/[0-9\/]+$']);

but it does not work:

http://ift.tt/1jrEXE4

I get page 404...

How i can make it?

P.S: I just started learning laravel.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire