Filename PHP conventions

1.6k Views Asked by At

I've developed many web applications over the past time and I never found myself adhering to any naming conventions when it comes to filenames. I have a PHP view where you can add users. Here are some suggestions I used over the time occasionally now and then this and that. So, is there anything like a convention to it or is it arbitrary?

  • user_add.blade.php
  • users_add.blade.php
  • user_add.blade.php
  • add_user.blade.php
  • add_users.blade.php
  • useradd.blade.php
  • adduser.blade.php
2

There are 2 best solutions below

2
On

The file naming system are arbitary. There is no particular method of naming a file. Use what you like. There is only restrictions in naming a Class or writing a variable. There are no standard naming conventions

2
On

Just follow the PSR-4.

The terminating class name corresponds to a file name ending in .php. The file name MUST match the case of the terminating class name.