0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

【Laravel】Artisan よく使うコマンド集

Posted at

Laravelでプログラムを書いているときに、比較的よく使うコマンドの備忘録です。

Artisan

route:list

ルーティング定義の一覧を表示

$ php artisan route:list

make:migration

マイグレーションファイルを作成

$ php artisan make:migration create_sample_table --create=samples

migrate

マイグレーションの実行

$ php artisan migrate

migrate:rollback

直前に実行したマイグレーションの取り消し

$ php artisan migrate:rollback

migrate:reset

全てのマイグレーションを取り消し

$ php artisan migrate:reset

make:model

モデルの作成
テーブル名の単数形を名前に付けることで、テーブルとオブジェクトがマッピングされ、
クラス経由でDB操作が可能になります。

$ php artisan make:model Sample

make:seeder

シーダーファイルの作成

$ php artisan make:seeder SamplesTableSeeder

db:seed

シーディングを実行

$ php artisan db:seed

make:controller

コントローラの作成

$ php artisan make:controller SampleController

make:request

バリデーションの作成

$ php artisan make:request SampleRequest

make:component

コンポーネントの作成

$ php artisan make:component Sample
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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?