title: Why running composer install --no-dev I got error with Barryvdh\Debugbar\ServiceProvider?
body: <p>I install my laravel 5.7 app (production) at live server and with no dev tools command command I got error:</p>
  
  <pre><code>composer install --no-dev
  ...
  
    - Removing barryvdh/laravel-debugbar (v3.2.1)
  Generating optimized autoload files
  &gt; Illuminate\Foundation\ComposerScripts::postAutoloadDump
  &gt; @php artisan package:discover
  </code></pre>
  
  <p>In ProviderRepository.php line 208:</p>
  
  <pre><code>  Class 'Barryvdh\Debugbar\ServiceProvider' not found  
  
  
  
  Script @php artisan package:discover handling the post-autoload-dump event returned with error code 1
  </code></pre>
  
  <p>In my composer.json I have barryvdh/laravel-debugbar under dev block:</p>
  
  <pre><code>{
      "name": "laravel/laravel",
      "description": "The Laravel Framework.",
      "keywords": ["framework", "laravel"],
      "license": "MIT",
      "type": "project",
      "require": {
          "php": "^7.1.3",
          ...
      },
      "require-dev": {
          "barryvdh/laravel-debugbar": "^3.1",
          "filp/whoops": "^2.0",
          "fzaninotto/faker": "^1.4",
          "mockery/mockery": "^1.0",
          "nunomaduro/collision": "^2.0",
          "orangehill/iseed": "^2.6",
          "phpunit/phpunit": "^7.0",
          "xethron/migrations-generator": "^2.0"
      },
  </code></pre>
  
  <p>In my config/app.php I have :</p>
  
  <pre><code>'providers' =&gt; [
      ...
      Barryvdh\Debugbar\ServiceProvider::class,
  'aliases' =&gt; [
      ...
      'Debugbar'         =&gt; Barryvdh\Debugbar\Facade::class,
  </code></pre>
  
  <p>Why this error and how to fix it?</p>
  
  <p>Thanks!</p>