LoginSignup
2
0

More than 1 year has passed since last update.

Laravel artisanでよく使うコマンド

Posted at

Laravel artisanでよく使うコマンドについて記載。

#controller作成
php artisan make:controller Controller

#Model作成
php artisan make:model User

#Modelの生成先を指定したい場合
php artisan make:model Models`\\`User

#migrationファイルの作成
php artisan make:migration 

#migrationを戻す(--stepに指定数分巻き戻される。現在の状況はmigrationテーブルを参照)
php artisan migrate:rollback --step=1

#認証機能を作成したい場合
php artisan make:auth

#artisanコマンド作成
php artisan make:command     

#イベントククラス作成     
php artisan make:event 

#listenerクラス作成   
php artisan make:listener   

#exceptionクラス作成           
php artisan make:exception       

#Create a new model factory 
php artisan make:factory          

#jobクラス作成
php artisan make:job           

#emailクラス作成     
php artisan make:mail             

#middlewareクラス作成
php artisan make:middleware            

#notificationクラスの作成
php artisan make:notification     

#policyクラスの作成
php artisan make:policy           

#service providerクラスの作成
php artisan make:provider         

#requestクラス作成
php artisan make:request          

#resourceの作成
php artisan make:resource         

#validation ruleの作成
php artisan make:rule             

#seederクラス作成
php artisan make:seeder    

#testクラスの作成       
php artisan make:test  

#cache削除
php artisan cache:clear
php artisan config:clear
php artisan route:clear
php artisan view:clear
php artisan clear-compiled

#cache削除(1回で上記を実行)
php artisan optimize:clear

#Composerのオートローダを再生成(artisanではないが)
composer dump-autoload

#キャッシュ作成(config、routeのキャッシュクリア、キャッシュを行う。)
php artisan optimize


以上

2
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
2
0