Search code examples
viewnaming-conventionsmodelscontrollerslaravel

What are the Laravel naming conventions for controllers/models/views?


I remember hearing you should name your controllers, models and views in a special way. Either singular or plural. I don't remember which ones to name what though, and i can't find anything about it in the doc.

I'm guessing it's like this:

  • Controllers are plural
  • Views are plural
  • Models are singular

Am i on the right track?

I understand it's just a convention and you don't have to follow them, but i still want to know what the right way is.


Solution

  • In ASP.NET MVC, I use the convention you mentioned above, expect for Views, which are mixed. If I have a view that displays multiple "things", such as a list of Employees, it is plural. If I have a view that displays a single Employee, it is singular.