11
8

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 7.4でデバッグバーを使用する方法

Last updated at Posted at 2020-04-18

barryvdh/laravel-debugbarをインストール

  • compose
cd your/laravel/project/path
composer require barryvdh/laravel-debugbar

config値を設定

config/debugbar.phpを作成。

  • 下記のコマンドを叩くと、config/debugbar.php が作成される。

     cd your/laravel/project/path
     php artisan vendor:publish --provider="Barryvdh\Debugbar\ServiceProvider"
    

config/app.php

  • config/app.phpの'debug'項目値をtrueに設定する。

  • また、providersとaliasesに下記を追加 Laravel 5.5以降は不要になったらしい。

    config/app.php
     	...
     	
     	/*
     	|--------------------------------------------------------------------------
     	| Application Debug Mode
     	|--------------------------------------------------------------------------
     	|
     	| When your application is in debug mode, detailed error messages with
     	| stack traces will be shown on every error that occurs within your
     	| application. If disabled, a simple generic error page is shown.
     	|
     	*/
     
     	'debug'           => env('APP_DEBUG', false),
     	
     	...
    
  • 上記のようになっているので、.env.xxxxで設定。

    .env.xxxxx
     APP_DEBUG=true
    

結果

  • デバッグバーが表示されるようになった!
    LaravelDebugbar.png
11
8
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
11
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?