mercredi 31 janvier 2018

Laravel Route URI: Add or condition

I have written a route with uri, which accepts /app/12/password

Route::get('app/{id}/password', 'AppController@pwd')->name('apwd');

Now i want to extend it to also accept /app/12/pwd. What is standard way to do this, since i can't write different route. I tried.

Route::get('app/{id}/(pwd|password)', 'AppController@pwd')->name('apwd');

Any help is appreciated.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire