lundi 26 octobre 2015

Laravel 5 Dynamic Named Routes

i want to use route() to generate the urls.

e.g.

route('auth.facebook.getSocialAuth') route('auth.twitter.getSocialAuth')

in routes.php is there a way to dynamically generate the 'as' part of the route?

if CodeIgniter, what i would do is put $1 to get the dynamic {provider}

Route::get('connect/{provider}', ['as' => 'auth.$1.getSocialAuth', 'uses' => 'Auth\AuthController@getSocialAuth']);

How can i achieve that in Laravel?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire