モデルの作成
モデル名の頭文字は大文字にする
php artisan make:model Models/Test
マイグレーションの作成
php artisan make:migration create_tests_table
ルール
- モデル名と同じ名前にする(ただし頭文字は小文字)
- モデル名の複数形にする
マイグレーションの実行
php artisan migrate
ルートの確認
1. ターミナルで確認
php artisan route:list
2. テキストファイルで確認
テキストファイルにしたほうがターミナルより見やすいです
php artisan route:list > route.text
コントローラ作成
頭文字は大文字にする
php artisan make:controller TestController
シーダー作成
php artisan make:seeder ContactFormSeeder
シーダー実行
php artisan db:seed
エラーが出るなどして実行できない場合
リフレッシュしてから実行してみてください
php artisan migrate:fresh --seed
対話型コンソール
php artisan tinker