LoginSignup
0
2

More than 3 years have passed since last update.

Debugbar をインストール

Posted at

Debugbarを使う。

まずは、Debugbarをインストールします。

$ composer require --dev barryvdh/laravel-debugbar

次にDebugbarの設定ファイルを作成します。

$ php artisan vendor:publish --provider="Barryvdh\Debugbar\ServiceProvider"

ここで作成された環境設定ファイル「.env」に、設定情報を記載します。

以下のいずれかを追記する。

DEBUGBAR_ENABLED=null  # デフォルト。APP_DEBUGに応じて決まる
DEBUGBAR_ENABLED=true  # 必ず有効
DEBUGBAR_ENABLED=false # 必ず無効

これでデバッグを行う準備ができました。
デバッグしたい場所に次のコードを記述すればデバッグすることができます。

 \Debugbar::info(確認したい変数など);

これでOKです!

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