Route URL laravel 4
Posted
by
nabil l.
on Stack Overflow
See other posts from Stack Overflow
or by nabil l.
Published on 2014-05-29T11:58:15Z
Indexed on
2014/06/06
9:25 UTC
Read the original article
Hit count: 182
laravel-4
How can I do this in Laravel 4
URL::route('auth.reset', array('kh34KHh4K342'))
Instead of
http://domain.tld/auth/reset?kh34KHh4K342
I want to get this :
http://domain.tld/auth/reset/kh34KHh4K342
EDIT
This my routes.php :
The problem is because I have two routes with the same name? How do you explain that ?
Should i set a different name event is the same kind, and different methods
// Set locale
$locale = Request::segment(1);
if(in_array($locale, Config::get('app.languages'))) {
\App::setLocale($locale);
} else {
$locale = null;
}
Route::group(
array( 'prefix' => $locale ), function () {
Route::get('/'), array( 'uses' => 'HomeController@getIndex', 'as' => '/' ));
// Auth
Route::group(
array( 'prefix' => 'auth' ), function () {
// Login
Route::get(
'login', array( 'before' => 'guest',
'uses' => 'UserController@getLogin',
'as' => 'auth.login' )
);
Route::post(
'login', array( 'before' => 'guest|csrf',
'uses' => 'UserController@postLogin',
'as' => 'auth.login' )
);
Route::get(
'reset/{$token}', array( 'uses' => 'UserController@getReset',
'as' => 'auth.reset' )
);
Route::post(
'reset', array( 'uses' => 'UserController@postReset',
'as' => 'auth.reset' )
);
}
);
© Stack Overflow or respective owner