Q:

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.

A:

You may try this:
Route::get('app/{id}/{param}', 'AppController@pwd')
->where('param', 'pwd|password') // param will accept either 'pwd' or 'password'
->name('apwd');

