Home >> Laravel 8.X >> What is Routing in Laravel 8.X

What is Routing in Laravel 8.X

Laravel Routing provide all requests are linked with the routes.

The routes/web.php file defines routes that are for your web pages.

These routes are assigned the web middleware group, which provides features like session state and CSRF protection. 

The routes in routes/api.php are stateless and are assigned the api middleware group.

Router Methods







Redirect Routes

Redirect Routes used for a route that redirects from one URI to another URI.
you can use the Route::redirect method. 

Route::redirect('/fromurl', '/tourl');

View Routes

View Routes used to return a view. 
you may use the Route::view method.

Route::view('/welcome', 'welcome');

Post Your Comment

Next Questions
What is Middleware

Copyright ©2022 coderraj.com. All Rights Reserved.