I want dynamic uri for Auth routes depending on the language.
Is there a way to get a route result by name?
For example with the Auth routes:
Route::get(route('login')); Thank you for your ideas...
I want dynamic uri for Auth routes depending on the language.
Is there a way to get a route result by name?
For example with the Auth routes:
Route::get(route('login')); Thank you for your ideas...
I normally use them as such:
//Routes Route::post('/login',[ 'uses'=>'HomeController@login', 'as'=>'login' ]); // Calling them in blade {{route('login')}} -> xxxxx/login You can still get more information on the best documentation of the world: https://laravel.com/docs/5.4/routing#named-routes
If you want the url for the named route, for example to use it in your views, you should just use route('routename') (ofcourse you should replace route_name with the name of your route). You do not need the Route::get around that, the Route::get/post/put/patch/delete functions are for defining new routes, not to get the url for a route.
Take a look at https://laravel.com/docs/5.4/routing#named-routes on how to create named routes and properly link to them.