Laravel 5: Enable laravel-debugbar

前端 未结 12 1518
星月不相逢
星月不相逢 2020-12-23 14:19

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:

相关标签:
12条回答
  • 2020-12-23 14:49

    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,

    0 讨论(0)
  • 2020-12-23 14:49

    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
    
    0 讨论(0)
  • 2020-12-23 14:49

    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.

    0 讨论(0)
  • 2020-12-23 14:53

    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.

    0 讨论(0)
  • 2020-12-23 14:55

    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.

    0 讨论(0)
  • 2020-12-23 14:56

    you can go to...

     project foler name->app->app.php
    
    set and 'debug' => true,
    
    This is working perfectly..
    
    0 讨论(0)
提交回复
热议问题