Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

should laravel controllers/views sub-dir be singular or plural #52

Open
sinkcup opened this issue Sep 7, 2019 · 3 comments
Open

should laravel controllers/views sub-dir be singular or plural #52

sinkcup opened this issue Sep 7, 2019 · 3 comments

Comments

@sinkcup
Copy link

sinkcup commented Sep 7, 2019

Laravel UI build-in:

should controllers/views sub-dir be singular or plural?

for example: https://github.com/settings/profile

  • controllers path: Controllers/Settings/ProfileController.php or Controllers/Setting/
  • views path: views/settings/profile.blade.php or views/setting/
  • route name: settings.profile or setting.profile

image

@alexeymezenin
Copy link
Owner

I use both, depending on the context. For example, views/admin/emails where admin is singular and emails is plural

@sinkcup
Copy link
Author

sinkcup commented Sep 10, 2019

@alexeymezenin

URI example.com/settings/profile

should use Controllers/Settings/ or Controllers/Setting/, views/settings/ or views/setting/, settings.profile or setting.profile?

is there a best practice or standard?

@Konafets
Copy link

The best practice is here: It depends on the context.

Your examples from Laravel UI describe different things. The controller is singular because it handles the resetting of a password, while the view folder passwords acts as a collection for all views regarding password handling. The route name is singular because its seen from the viewpoint of a user, which has only one password.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants