search

Laravel Naming Conventions

Comments:
Likes:
Shares:
Best Division

Best Division  @bestdivision

Published On - Last Updated -

Laravel Naming Conventions

Table Names:

users, blogs, comments ( Entity )

user_blog, user_comment ( Relationship )

Column Names should be singular:

id, user_id, post_id 

Note:

  • Primary Key should be used simply as id. You can follow tablename_id also. But I personally prefer simply id.
  • Foreign Key should follow tablename_id. E.g. user_id, post_id.

Controllers Name should be singular Pascal Camel Case ( Upper Camel Case):

BlogController, UserController

Models should be singular Pascal Camel Case

User, Blog

Similar Blogs
0 Commentssort Sort By

@abcd 1 days ago

Aquí los que apoyamos a Los del limit desde sus inicios..

dislike
reply
sdfsdf