LoginSignup
5
4

More than 1 year has passed since last update.

【Laravel】テーブル名の複数形に迷わない方法

Posted at

Laravelは命名規則としてテーブル名には複数形を付ける。
user→users
item→items
のような形。
https://naoya-ono.com/blog/laravel-naming-rule/

今まではGoogle検索で「movie 複数形」のように調べていた。
ちょっとめんどくさい。でも念のため調べておかないとスペルミスしたときは後々さらにめんどくさい。

解決法

php artisan tinker
>>> echo Str::plural('単語名');

これだけ!シンプル。

5
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
4