In every laravel project explicit controller is very common routing that developer team use.
Explicit routing is pointing every action ( GET, POST) to a function of a controller. Explicit controller provide a clearer view function and routing name. Explicit controller was use to add additional method or method with specific naming convention.
Example of explicit controller that can be find in my project.
//return customer list Route::get('customers', 'CustomerController@index');
//create customer form Route::get('/create','CustomerController@showCustomerForm'); //store customer form Route::post('/create','CustomerController@store');IMPLICIT CONTROLLER (Deprecated)
Implicit controller is flexible because it allows you to easily define a single route to handle every action in a controller. You can define the route using the
controller method. The controller method accepts two arguments, first is URI the controller handles, while the second is the class name of the controller.
According to laravel 5.0 documentation :
However implicit controller deprecated in Laravel 5.2. The call
Route::controllerwas just added as an extra helper.
A restful controller can be found with some default routes and naming action .
Actions Handled By Resource Controller
According to laravel 5.4 documentation HTML forms can't make
requests, from here we neeed to add spoofing method in <form> tag. The method field can be define like below :