laravel naming conventions

Gegasoft uses the following name conventions for laravel
=============================================================
Variables	=>	camelCase	=>	$articlesWithAuthor
Collection Variable	=>	descriptive, plural	=>	$activeUsers = User::active()->get()
Object Variable	=>	descriptive, singular	=>	$activeUser = User::active()->first()
View	=>	snake_case	=>	show_filtered.blade.php
Controllers	=>	singular, ProperCase	=>	ArticleController
Model Name	=>	singular, ProperCase	=>	User, FollowingRequest
Model attribute/property	=>	snake_case	=>	$model->created_at
Method	=>	camelCase	=>	getAll
Method in resource controller	=>	table	=>	store
Method in test class	=>	camelCase	=>	testGuestCannotSeeArticle
hasOne/belongsTo relation	=>	singular	=>	articleComment
Other relations	=>	plural	=>	articleComments
Table Name =>	plural	=>	article_comments
Table column	=>	snake_case without model name	=>	meta_title
Route	=>	plural	=>	articles/1
Named route	=>	snake_case with dot notation	=>	users.show_active
Primary key	=>	-	=>	id
Foreign key	=>	singular model name with _id suffix	=>	article_id
Pivot table	=>	singular model names in alphabetical order	=>	article_user
Migration	=>	-	=>	2017_01_01_000000_create_articles_table
Config and language files index	=>	snake_case	=>	articles_enabled
Config	=>	snake_case	=>	google_calendar.php
Contract (interface)	=>	adjective or noun	=>	Authenticatable
Trait	=>	adjective	=>	Notifiable

5
1

                                    $post = Post::find(1);$post->comments()->saveMany([ new Comment(['message' => 'First comment']), new Comment(['message' => 'Second comment']),]);

5 (1 Votes)
0
Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
laravel naming conventions laravel daily laravel variable naming Controller naming conventions laravel laravel states best practices naming convention laravel controller properties naming convention laravel examples laravel app best practice php naming conventions models laravel model name convention laravel laravel index naming conventions laravel folder naming convention laravel function parameter naming convention laravel function parameter naming conventions laravel architecture best practices laravel controller method naming convention laravel naming convention guide Laravel 7 naming conventions laravel variable naming convention which naming conventions is more used in laravel frameword best practices for laravel blade components naming convention laravel component naming convention blade naming convention laravel convention model naming convention laravel controller naming convention laravel naming convention laravel laravel 8 best practices file naming convention examples laravel laravel project best practices laravel conventions laravel naming conventions for blade files laravel database name convention laravel naming conventions function name laravel code convention laravel names conventions how to develop laravel in best practices laravel sample project with best practices laravel bad practices how to write laravel in best practices naming method laravel laravel good practices laravel model naming convention Tips & best practices for Laravel 8 app content laravel best practices laravel traits best practices laravel blade naming convention best laravel best practices laravel naming conventions docs laravel naming conventions laravel 7 naming convention for laravel mvc laravel 7 best practices laravel the best practice laravel database naming conventions laravel traits naming convention laravel migration naming convention entity naming convention laravel model naming convention in laravel laravel trait naming convention naming in laravel 8 laravel command naming convention laravel code best practices laravel database naming convention laravel naming convention column name laravel convention for naming convention laravel model naming conventions Laravel function naming conventions Laravel 8 naming conventions convention laravel laravel name convention laravel best practices example best practices template laravel projects laravel variable name convention laravel best structure practices laravel official naming convention naming conventions with laravel php variable naming conventions laravel laravel method naming conventions laravel best practices 2020 laravel best practices to update best practices for using laravel laravel 8 practise how to define naming for laravel function laravel best practice to genrate document laravel key practices laravel naming convention best practice laravel laravel best coding practices laravel best practices 2019 use method best practice laravel laravel query builder best practices what is laravel best practices lumen naming conventions model emtity laravel structure best practices laravel patterns best practices why laravel table naming laravel naming conventions controller laravel naming conventions laravel controller naming convention laravel migrations naming convention convention laravel view naming best practices laravel laravel naming conventions model table name convention laravael laravel best code how to practice coding in laravel best ways to code in laravel sql server laravel camel case convention namin convention laravel laravel best practices alexeymezenin pdf php variable naming convention laravel laravel conventional names laravel best practices for id laravel table naming conventions best naming convention for order controller for user view laravel naming laravel controllers best practices database naming conventions laravel best practse How tname request in laravel best practice tp name request in laravel php file naming conventions laravel naming convention varible laravel variable names naming convention laravel laravel database name limitations laravel variables best practices name convention laravel naming convention in laravel laravel 8 teams best practices conventions laravel best practice laravel blade how to practice laravel controller best practices laravel laravel function name best practices laravel best practices using controller laravel naming convensions best practices in laravel laravel services best practices laravel 6 best practices laravel coding best practices laravel best practice anton Tykholiz laravel best practicw best practice on laravel laravel coding technics Laravel best practices
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source