Posted On: Apr 19, 2024
Laravel Reverse routing is the process of generating the URL based on name or symbol. It generates URL's based on route declarations. Reverse routing makes your application so much more flexible and helps the developer to write cleaner codes in View. It defines a relationship between links and Laravel routes. When a link is created by using names of existing routes, appropriate Uri's are created automatically by Laravel.
// route declaration
Route::get('login', 'users@login');
Using reverse routing we can create a link to it and pass in any parameters that we have defined. Optional parameters, if not supplied, are removed from the generated link.
{{ HTML::link_to_action('users@login') }}
It will automatically generate an Url like http://xyz.com/login in view.
Never Miss an Articles from us.
Laravel is a free open source "PHP framework" based on the MVC design pattern. It is created by Taylor Otwell...