laravel controller name should be plural or singular?
Here is a list of naming conventions accepted by Laravel community. According to this, Controller name should be Singular although you could chose your own convention as your need or how your team prefer.
Plural. Although the official laravel docs use singular for controller names, it is very well known that most of prominent laravel developers such as Jeffrey Way, Adam Wathan, Chris Fidao and many others uses plural for controller names that it sort of become the actual standard.
You are far better off using plural so you feel less confusion when you watch their videos, read their blog posts.etc
You should follow those naming convention:
- Model Name should be singular e.g: 'Profile', not 'Profiles'
- Controller name should be singular with 'Controller' suffix e.g: 'ProfileController', not 'ProfilesController'
- Php class Name should be in 'StudlyCase' format e.g: 'TestClass'
- Php function Name should be in 'camelCase' format e.g: 'testFunction'
Class constants MUST be declared in all upper case with underscore separators; for example:
class Foo { const VERSION = '1.0'; const DATE_APPROVED = '2012-06-01'; }
Useful link:
https://www.php-fig.org/psr/psr-1/