Abdus Sattar Bhuiyan
Abdus Sattar Bhuiyan

Reputation: 3074

What is the naming convention of view folder for CamelCase type controller

I have a controller named: CustomAuthController. Now I want to create a folder for this controller. What should I choose for this folder name. I mean what name is the best practice for laravel. is custom_auth is best pick. Is there any rule?

Upvotes: 2

Views: 4746

Answers (1)

Abhay Maurya
Abhay Maurya

Reputation: 12277

View folders in Laravel are made to help the structure of the front end of the app. It has nothing to do with what Controller you use to provide functionality for it.

For instance, you can have the layouts folder where you put all your blades which can be used into another blade as a reusable section. The views under layouts folder might also use your CustomAuthController controller. Does that make sense?

Name your view folders in a way which helps you understand the front end structure of your website.

As for the naming convention, always try to keep it one word, all small case and usually a plural word as it holds a group of blade views.

If you need to make it as two words, mostly snake_case is used but there is no written rule about it.

Upvotes: 5

Related Questions