All controllers in Laravel 5 are still called the suffix Controller, for example, AuthControllerand PasswordController. Is there any reason to follow this agreement with my own controllers, or are these suffixes left over from the era preceding the names?
Controller
AuthController
PasswordController
I use action-based URL generation most of the time, so I avoid linking like url('home'), but instead I prefer something like action('HomeController@index). This way I can change the URL patterns without a headache.
url('home')
action('HomeController@index)
But action('Home@index')so elegant. Any traps behind him?
action('Home@index')
There is no need to add a controller suffix. If it was really necessary, when you create the Controller through a craftsman, he automatically adds it or complains about it, but this is not so. So, don't be shy (but keep in mind that if you want a Dog controller and there is a Dog model ... well, that will be difficult).
. . . Home HomeController. action('Home@index') . Laravel - . , . . Controller , . use home use app\home . .
use home
use app\home
Controller . , . DogController Dog. , , DogController.
DogController
Dog
, App\Http\Controllers\DogController, , ? , PHP use App\Http\Controllers\DogController;, DogController .
App\Http\Controllers\DogController
use App\Http\Controllers\DogController;
, Laravel . , , Laravel , , Laravel .
Source: https://habr.com/ru/post/1605706/More articles:How to save changed data in the Curve Fitting Toolbox? - matlabHow to send a push notification via GCM to an iOS device? - iosShare iOS extension not working - iosSave socket response to string in Perl - stringDelete line in Windows CMD in Perl - cmdhow to add angular radius and addition to multi-line stretchable text - androidIs it possible to use text-to-speech using the Apple Watch WatchKit? - iosHow to programmatically manage a sound card? - pythonHow to combine an array of hashes by prioritizing non-nil values - ruby | fooobar.comHow to convert JSO to JSON? - jsonAll Articles