Skip to content

Commit

Permalink
Conventions table changed
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeymezenin committed Nov 23, 2017
1 parent 233261c commit 15368cc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -442,17 +442,17 @@ What | How | Good | Bad
------------ | ------------- | ------------- | -------------
Controller | singular | ArticleController | ~~ArticlesController~~
Route | plural | articles/1 | ~~article/1~~
Named route | - | users.show_active | ~~users.show-active, show-active-users~~
Named route | snake_case with dot notation | users.show_active | ~~users.show-active, show-active-users~~
Model | singular | User | ~~Users~~
hasOne or belongsTo relationship | singular | articleComment | ~~articleComments, article_comment~~
All other relationships | plural | articleComments | ~~articleComment, article_comments~~
Table | plural | article_comments | ~~article_comment, articleComments~~
Pivot table | singular model names in alphabet order | article_user | ~~user_article, articles_users~~
Table column | - | meta_title | ~~MetaTitle; article_meta_title~~
Table column | snake_case without model name | meta_title | ~~MetaTitle; article_meta_title~~
Foreign key | singular model name with _id suffix | article_id | ~~ArticleId, id_article, articles_id~~
Primary key | - | id | ~~custom_id~~
Migration | - | 2017_01_01_000000_create_articles_table | ~~2017_01_01_000000_articles~~
Method | - | getAll | ~~get_all~~
Method | camelCase | getAll | ~~get_all~~
Method in resource controller | [table](https://laravel.com/docs/master/controllers#resource-controllers) | store | ~~saveArticle~~
Method in test class | camelCase | testGuestCannotSeeArticle | ~~test_guest_cannot_see_article~~
Variable | camelCase | $articlesWithAuthor | ~~$articles_with_author~~
Expand Down
8 changes: 4 additions & 4 deletions russian.md
Original file line number Diff line number Diff line change
Expand Up @@ -438,23 +438,23 @@ e2e тестирование | Laravel Dusk | Codeception
------------ | ------------- | ------------- | -------------
Контроллер | ед. ч. | ArticleController | ~~ArticlesController~~
Маршруты | мн. ч. | articles/1 | ~~article/1~~
Имена маршрутов | - | users.show_active | ~~users.show-active, show-active-users~~
Имена маршрутов | snake_case | users.show_active | ~~users.show-active, show-active-users~~
Модель | ед. ч. | User | ~~Users~~
Отношения hasOne и belongsTo | ед. ч. | articleComment | ~~articleComments, article_comment~~
Все остальные отношения | мн. ч. | articleComments | ~~articleComment, article_comments~~
Таблица | мн. ч. | article_comments | ~~article_comment, articleComments~~
Pivot таблица | имена моделей в алфавитном порядке в ед. ч. | article_user | ~~user_article, articles_users~~
Столбец в таблице | - | meta_title | ~~MetaTitle; article_meta_title~~
Столбец в таблице | snake_case без имени модели | meta_title | ~~MetaTitle; article_meta_title~~
Внешний ключ | имя модели ед. ч. и _id | article_id | ~~ArticleId, id_article, articles_id~~
Первичный ключ | - | id | ~~custom_id~~
Миграция | - | 2017_01_01_000000_create_articles_table | ~~2017_01_01_000000_articles~~
Метод | - | getAll | ~~get_all~~
Метод | camelCase | getAll | ~~get_all~~
Метод в контроллере ресурсов | [таблица](https://laravel.com/docs/master/controllers#resource-controllers) | store | ~~saveArticle~~
Метод в тесте | camelCase | testGuestCannotSeeArticle | ~~test_guest_cannot_see_article~~
Переменные | camelCase | $articlesWithAuthor | ~~$articles_with_author~~
Коллекция | описательное, мн. ч. | $activeUsers = User::active()->get() | ~~$active, $data~~
Объект | описательное, ед. ч. | $activeUser = User::active()->first() | ~~$users, $obj~~
Индексы в конфиге и языковых файлах | - | articles_enabled | ~~ArticlesEnabled; articles-enabled~~
Индексы в конфиге и языковых файлах | snake_case | articles_enabled | ~~ArticlesEnabled; articles-enabled~~
Представление | snake_case | show_filtered.blade.php | ~~showFiltered.blade.php, show-filtered.blade.php~~
Конфигурационный файл | snake_case | google_calendar.php | ~~googleCalendar.php, google-calendar.php~~
Контракт (интерфейс) | прилагательное или существительное | Authenticatable | ~~AuthenticationInterface, IAuthentication~~
Expand Down

0 comments on commit 15368cc

Please sign in to comment.