0
0

More than 3 years have passed since last update.

Laravel artisanコマンド逆引き

Posted at

Laravelでは、アプリ開発に便利な数多くのコマンド・Artisanが用意されています。これらのコマンドを活かすことで、より労力を少なく効率的な開発が可能となります。

コマンド一覧を確認する

php artisan list

どのrouteが設定されているか確認する

php artisan route:list

対話型のコンソールtinkerの起動

php artisan tinker

マイグレーションファイルとテーブルの作成

php artisan make:migration create_shops_table --create=shops

マイグレーションの実行

php artisan migrate

モデルクラスファイルのひな形作成

php artisan make:model <モデル名>

コントローラークラスファイルのひな形作成

php artisan make:controller <コントローラー名>

リクエストクラスのひな形作成

php artisan make:request <リクエストクラス名>

シーダー用ファイルの作成

php artisan make:seeder <シーダークラス名>

シーディングの実行

php artisan db:seed

テーブルを全削除して、再作成

php artisan migrate:fresh

テーブルを全削除して、再作成、シーディングまで実行

php artisan migrate:refresh --seed
0
0
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
0
0