...
/Introduction to Groups and Parameterized Routes in Laravel
Introduction to Groups and Parameterized Routes in Laravel
Learn about the implementation of route grouping, parameter passing, and various route-controller connection methods.
We'll cover the following...
Route attachment with controllers
In order to follow the principles of pure MVC, Laravel allows developers to attach incoming requests to the controller.
This attachment creates separation, which eventually promotes logic modularity and reusability. In the example, a route is mapping a URL request ('check_logic'
) to the controller named firstController
with a function named test
.
Route::get('check_logic','App\Http\Controllers\firstController@test');
Routes groups
In Laravel, route groups are a way to organize and manage routes. They allow us to group multiple routes together and apply common attributes or settings to them. This can help us to do the following:
Organize our routes: ...