42

I'm using Laravel 5 and would like to use the barryvdh/laravel-debugbar. After the installation and configuration the bar is not showing.

I did the following:

Installation:

composer require barryvdh/laravel-debugbar

Add the following lines to the config/app.php

'Barryvdh\Debugbar\ServiceProvider',

'Debugbar' => 'Barryvdh\Debugbar\Facade',

Further I execute:

php artisan vendor:publish

which generates the debugbar.php file within the config folder.

Any ideas what could be missing?

Thank you

UPDATE:

I made a fresh Laravel 5 installation and installed the debugbar which works perfectly and showed my the debugbar. After executing the artisan commands:

 php artisan cache:clear 

and

 php artisan config:cache

the debugbar is not visible anymore. I think this was also my problem of the previous question. Any ideas why this happens and how I can make the debugbar revisible?Thank you

Steve
  • 1,036
  • 2
  • 13
  • 31

13 Answers13

19

Try this command

php artisan config:clear
Łukasz D. Tulikowski
  • 1,440
  • 1
  • 17
  • 36
10

The installation instructions at https://github.com/barryvdh/laravel-debugbar#installation recommend setting the application debug mode to true. Also make sure, that you do not disable the debugbar in config/debugbar.php by setting the enabled=false > If I were you I would simply remove it. ( The debugbar won't work, event if the application itself is in debug mode )

Another suggestion

As far as I know the .env.example file should be renamed to .env and all apropriate variables should be set. In my case it always contains lines like this:

APP_ENV=local
APP_DEBUG=true`

Within the config/app.php file the debug value should be read from the environment variable.

return [
    /* some other config values here... */
    'debug' => env('APP_DEBUG'),
]

Note, that it should also be possible to simply set the value to true without using the environment based configuration values.

Maybe you can test it by manually calling \Debugbar::enable(); in one of your routes and debugging afterwards.

Hope this helps.

Remluben
  • 1,613
  • 2
  • 16
  • 21
6

I have had the same trouble, and it is usually solved clearing route caching.

php artisan route:clear

It seemed to be an issue which was already fixed, and you can find about it in the repository issue #287, but I'm still finding it from time to time.

Muihlinn
  • 561
  • 6
  • 8
3

Paste this lines in your Config/app.php surely it will work

  1. In providers:

Barryvdh\Debugbar\ServiceProvider::class,

  1. In aliases:

'Debugbar' => Barryvdh\Debugbar\Facade::class,

Francisco Cabral
  • 856
  • 11
  • 21
karthik
  • 56
  • 5
3

Open the terminal and to do like this as your wise

1) Install DebugBar

  • The DebugBar 2.4.x is for Laravel 5.4-
  • The DebugBar 3.0.x is for Laravel 5.5+

A) Install the debuger 2.4 (Documentation)

composer require barryvdh/laravel-debugbar:~2.4

You will also need to add in providers array in config/app.php :

Barryvdh\Debugbar\ServiceProvider::class

B) Install the debuger 3.0 (Documentation)

composer require barryvdh/laravel-debugbar --dev

2) After that, you need to update the composer

composer update

3) Then after you need to add a line to .env file

APP_DEBUG=true

4) Clear cache and config

php artisan cache:clear

php artisan config:cache
Shabeer K
  • 1,489
  • 16
  • 23
2

I had the same issue and tried all the previous solutions without success. Finnaly I solved my problem with the following detail fix:

Install instrucions:

If you use a catch-all/fallback route, make sure you load the Debugbar ServiceProvider before your own App ServiceProviders.

Community
  • 1
  • 1
Sergio B.
  • 81
  • 3
2

In my case, the problem was I had a wide route, Route::get('/{all?}','...') catching the debugbar one.

I managed to solve this by adding these routes before:

Route::get( '/api/_debugbar/assets/stylesheets', '\Barryvdh\Debugbar\Controllers\AssetController@css' );
Route::get( '/api/_debugbar/assets/javascript', '\Barryvdh\Debugbar\Controllers\AssetController@js' );
Sebastien Horin
  • 10,803
  • 4
  • 52
  • 54
1

I had this issue because I had catchall route in routes.php

Here was my fix:

  1. comment out the catchall route code block in routes.php
  2. clear the cache

    c:path/to/your/project> php artisan cache:clear

    c:path/to/your/project> php artisan route:clear

  3. load your poject home page in your browser and confirm that you can see the debugbar

  4. uncomment out the catchall route in routes.php

Hopefully this helps someone else.

jay ramone
  • 19
  • 1
  • 4
0

Check your storage/laravel.log file. In mine was:

local.ERROR: Debugbar exception: Authentication user provider [] is not defined.

Because I misconfigured something in auth.php and when I fixed that debugbar loaded successfully.

user570605
  • 738
  • 7
  • 9
0

If you're daft like me sometimes this can help. At the bottom of your page, make sure you don't write a <script /> but use the full closure eg. <script></script> This was my problem.

Don't Panic
  • 13,965
  • 5
  • 32
  • 51
0

to add debugger in your code step 1

  1. composer require barryvdh/laravel-debugbar --dev

inside config/app.php

  • Barryvdh\Debugbar\ServiceProvider::class,
  • 'Debugbar' => Barryvdh\Debugbar\Facade::class,

at last run this command

  1. php artisan vendor:publish --provider="Barryvdh\Debugbar\ServiceProvider"
Guillem
  • 2,376
  • 2
  • 18
  • 35
0

I have started learning Laravel from last few days, I was working on a small project. I took the backup from my live server and setup the project on my local system and after that I start facing the "Debug bar not showing" issue. I tried almost all the steps as suggested by you guys, but still no luck.

But this is how I found the solution, I hope someone will save some time by trying the below solution, if he is doing the same mistake.

I found one mistake in my .env file, my APP_URL was set to my live site like APP_URL=https://mylivesite.com, but I was testing on localhost, so after changing the APP_URL to "APP_URL=http://127.0.0.1:8000", and then follow the same steps as you guys are mentioning, It worked for me. Thanks!

-4

you can go to...

 project foler name->app->app.php

set and 'debug' => true,

This is working perfectly..
Ashish Singh
  • 2,043
  • 2
  • 11
  • 9