例)postを使用
目次
laravel artisan
アプリケーションキーの設定(APP_KEY)
php artisan key:generate
マイグレーション(migration)
マイグレーションの作成
php artisan make:migration create_posts_table --create=posts
//--create=テーブル名 → テーブルを作成
//-table=テーブル名 → すでに存在しているテーブルを更新
マイグレーションの実行
php artisan migrate
ロールバック
php artisan migrate:rollback
モデル(model)
モデルの作成
php artisan make:model Post
シーダー(seeder)
シーダーの作成
php artisan make:seeder TestPostsSeeder
シーダーの実行
php artisan db:seed
個別でシーダーの実行
php artisan db:seed --class=TestPostsSeeder
コントローラー(controller)
コントローラーの作成
php artisan make:controller PostController
コントローラーの作成(CRUDあり)
php artisan make:controller PostController --resource
キャッシュ系
.envファイル系のキャッシュ削除
php artisan config:cache
ルートのキャッシュ削除
php artisan route:cache
viewのキャッシュ削除
php artisan view:clear