「Laravel」Laravel Debugbar

Install use Composer

# composer require barryvdh/laravel-debugbar --dev
composer require barryvdh/laravel-debugbar:^2.3 --dev

P.S.You can find information in composer.json

set service provider AppServiceProvider.php

<?php

namespace App\Providers;

use Illuminate\Support\ServiceProvider;

class AppServiceProvider extends ServiceProvider
{
    /**
     * Bootstrap any application services.
     *
     * @return void
     */
    public function boot()
    {
        //
    }

    /**
     * Register any application services.
     *
     * @return void
     */
    public function register()
    {

        // ===== THIS IS Register LARAVEL DEBUGBAR 
        if ($this->app->environment() == 'local')
        {
            $this->app->register('Barryvdh\Debugbar\ServiceProvider');
        }
        //==========================

    }
}

set Facade config/app.php:

    'aliases' => [

        ...............        

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

    ],

];

check .env


APP_ENV=local
APP_DEBUG=true

參考

  1. https://my.oschina.net/u/2400083/blog/988715

「Laravel」 composer

install composer

curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer
sudo chmod +x /usr/local/bin/composer

instasll laravel


composer create-project --prefer-dist laravel/laravel PROJECT