Confused about naming your controllers? You’re not alone !!

Sometimes you may hesitate when naming controllers in Laravel:
should it be singular or plural?

According to Laravel best practices, controllers should be named in singular form.

Recommended examples:

  • CategoryController ✅
  • ProfileController ✅

Not recommended examples:

  • CategoriesController 🚫
  • ProfilesController 🚫

Laravel follows a clear and predictable pattern:

  • Model → singular (Category)
  • Controller → singular (CategoryController)
  • Route (URI) → plural (/categories)
  • View folders → plural (resources/views/categories)

#Why Singular?

A controller represents a resource, not a collection. For example a typical controller can display a list of resource, show a single resource, create a resource, update a resource and delete a resource.So even when dealing with multiple records, the controller itself remains singular.

#Is It Mandatory?

No, this rule is not enforced and you can use plural names for your controllers such as CategoriesController, but the main issue is consistency. consistency is more important than naming style itself.

# What is Consistency?

Consistency means following a single style throughout the entire project. In this case, if you are naming your controllers plural, keep it for all controllers, if you are using singular, use singular for all controllers.

never mix the styles. A bad example is like this :

  • UserController (singular name)
  • CategoriesController (plural name)

This creates confusion and reduces code readability.

# Conclusion

If you’re unsure how to name your Laravel controllers, just go with singular names. It keeps your project aligned with the framework’s conventions and makes your code easier to understand for other developers.