Laravel Naming conventions

WhatHowShould FollowNot to Use
ControllersingularPostControllerPostsController
Routepluralposts/1post/1
Named routesnake_case with dot notationusers.show_activeusers.show-active, show-active-users
ModelsingularUserUsers
hasOne or belongsTo relationshipsingularpostCommentpostComments, post_comment
All other relationshipspluralpostCommentspostComment, post_comments
Tablepluralpost_commentspost_comment, postComments
Pivot tablesingular model names in alphabetical orderpost_useruser_post, posts_users
Model propertysnake_case$model->created_at$model->createdAt
Foreign keysingular model name with _id suffixpost_idPostId, id_post, posts_id
Primary keyidcustom_id
Migrationdate_create_posts_table2019_05_08_posts
MethodcamelCasegetAllget_all
Method in resource controllertablestoresavePost
VariablecamelCase$postsWithAuthor$posts_with_creator