📜Naming Conventions
მოცემულ ცხრილში აღწერილია ყველაზე მნიშვნელოვანი და ხშირად დაშვებული შეცდომები Naming Convention-ებთან დაკავშირებით.
What | How | Case | Good | Bad |
---|---|---|---|---|
Variable | descriptive | camelCase | $profilePicture |
|
Model | Singular | PascalCase | User |
|
Controller | ❗Singular | PascalCase | PostController |
|
method | descriptive | camelCase | updateTaskPosition |
|
Route | ❗Plural | kebab-case | active-users/1 |
|
Named route | ❗resources. action | snake_case | users.show_active |
|
Collection | descriptive, plural | camelCase | $users |
|
database table | ‼️Plural | snake_case | posts |
|
Pivot table | ‼️Singular model names. in alphabetical order | snake_case | post_user |
|
hasOne or belongsTo relationship | ‼️Singular | camelCase | author |
|
All other relationships | ‼️Plural | camelCase | comments |
|
Last updated