title: Script php artisan optimize handling the post-update-cmd event returned with error code 1
body: <h2>General Information</h2>
  
  <p>Laravel Version: 5.4<br>
  PHP Version: 7.0.15<br>
  Operating System and Version: ubuntu 16.04</p>
  
  <h2>Issue Description</h2>
  
  <p>[I am upgrading from laravel 5.3 to 5.4 ]<br>
  In <code>composer.json</code> I have added <code>"toin0u/geocoder-laravel": "^1.0",</code>.I have also removed the <code>config/geocoder.php</code> configuration file .
  There is no Geocoder alias in the aliases section of the config/app.php.</p>
  
  <p>I have added <code>Geocoder\Laravel\Providers\GeocoderService::class,</code> in <code>config/app.php</code> . but still getting the error when I do <strong>composer update</strong>   or <strong>composer install</strong> .</p>
  
  <p>```     </p>
  
  <blockquote>
    <p>Nothing to install or update<br>
    Package egeloen/http-adapter is abandoned, you should avoid using it. Use >php-http/httplug instead.<br>
    Writing lock file
    Generating autoload files<br>
    Illuminate\Foundation\ComposerScripts::postUpdate<br>
    php artisan optimize    </p>
    
    <p><code>[Symfony\Component\Debug\Exception\FatalThrowableError]</code><br>
     <code>Class 'Toin0u\Geocoder\GeocoderServiceProvider' not found</code>  </p>
  </blockquote>
  
  <p>```
  My composer.json file looks like </p>
  
  <pre><code>{
  "name": "laravel/laravel",
  "description": "The Laravel Framework.",
  "keywords": ["framework", "laravel"],
  "license": "MIT",
  "type": "project",
  "minimum-stability": "dev",
  "prefer-stable": true,
  
  "require": {
      "php": "&gt;=5.6.4",
      "toin0u/geocoder-laravel": "^1.0",
      //"toin0u/geocoder-laravel": "@stable",
      "laravel/framework": "5.4.*",
      "illuminate/support": "5.4.x",
      "illuminate/console": "5.4.x",
      "symfony/process": "~3.2",
      "barryvdh/laravel-async-queue": "0.6.x",
      "laravelcollective/html": "5.4.x-dev"
  },
  "require-dev": {
      "fzaninotto/faker": "~1.4",
      "mockery/mockery": "0.9.*",
      "phpunit/phpunit": "~5.7",
      "symfony/css-selector": "3.1.*",
      "symfony/dom-crawler": "3.1.*",
      "barryvdh/laravel-debugbar": "^2.1"
  },
  "autoload": {
      "classmap": [
          "database",
          "app/Models",
          "database/migrations",
          "database/seeds",
          "app/libraries"
      ],
  "psr-4": {
          "App\\": "app/"
      }
  },
  
   "extra": {
      "branch-alias": {
          "dev-master": "0.6-dev"
      }
  },
  
  "autoload-dev": {
      "classmap": [
          "tests/TestCase.php"
      ]
  },
  "scripts": {
      "post-root-package-install": [
          "php -r \"file_exists('.env') || copy('.env.example', '.env');\""
      ],
      "post-create-project-cmd": [
          "php artisan key:generate"
      ],
      "post-install-cmd": [
          "Illuminate\\Foundation\\ComposerScripts::postInstall",
          "php artisan optimize"
      ],
      "post-update-cmd": [
          "Illuminate\\Foundation\\ComposerScripts::postUpdate",
          "php artisan ide-helper:generate", 
          "php artisan ide-helper:meta",
          "php artisan optimize"
      ]
  },
  "config": {
      "preferred-install": "dist"
  }
  </code></pre>
  
  <p>}</p>
  
  <p>I was using Class 'Toin0u\Geocoder\GeocoderServiceProvider' in my config/app.php file ,thought it could be the problem as it is unable to find this class so I removed this from there still getting the same error message.
  Please Help .
  Thank-you in advance !</p>
  
  <p>Edited:
  My new app.php looks like this:(I have commented the lines involving Geocoder)</p>
  
  <pre><code>&lt;?php
  </code></pre>
  
  <p>/*code after providers */</p>
  
  <pre><code>'providers' =&gt; [
  
      /*
       * Laravel Framework Service Providers...
       */
      Illuminate\Auth\AuthServiceProvider::class,
      Illuminate\Broadcasting\BroadcastServiceProvider::class,
      Illuminate\Bus\BusServiceProvider::class,
      Illuminate\Cache\CacheServiceProvider::class,
      Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class,
      Illuminate\Cookie\CookieServiceProvider::class,
      Illuminate\Database\DatabaseServiceProvider::class,
      Illuminate\Encryption\EncryptionServiceProvider::class,
      Illuminate\Filesystem\FilesystemServiceProvider::class,
      Illuminate\Foundation\Providers\FoundationServiceProvider::class,
      Illuminate\Hashing\HashServiceProvider::class,
      Illuminate\Mail\MailServiceProvider::class,
      Illuminate\Notifications\NotificationServiceProvider::class,
      Illuminate\Pagination\PaginationServiceProvider::class,
      Illuminate\Pipeline\PipelineServiceProvider::class,
      Illuminate\Queue\QueueServiceProvider::class,
      Illuminate\Redis\RedisServiceProvider::class,
      Illuminate\Auth\Passwords\PasswordResetServiceProvider::class,
      Illuminate\Session\SessionServiceProvider::class,
      Illuminate\Translation\TranslationServiceProvider::class,
      Illuminate\Validation\ValidationServiceProvider::class,
      Illuminate\View\ViewServiceProvider::class,
  
      /*
       * Package Service Providers...
       */
      Collective\Html\HtmlServiceProvider::class,
      /*registering the Geocoder Service Provider */
  
      //Geocoder\Laravel\Providers\GeocoderService::class,
  
  
      /*
       * Application Service Providers...
       */
      App\Providers\AppServiceProvider::class,
      App\Providers\AuthServiceProvider::class,
      // App\Providers\BroadcastServiceProvider::class,
      App\Providers\EventServiceProvider::class,
      App\Providers\RouteServiceProvider::class,
      // Way\Generators\GeneratorsServiceProvider::class,
      NoHasl\Providers\FormatServiceProvider::class,
      NoHasl\Providers\GeoIPServiceProvider::class,
      //Toin0u\Geocoder\GeocoderServiceProvider::class,
      Barryvdh\Queue\AsyncServiceProvider::class,
  
  ],
  
  /*
  |--------------------------------------------------------------------------
  | Class Aliases
  |--------------------------------------------------------------------------
  |
  | This array of class aliases will be registered when this application
  | is started. However, feel free to register as many as you wish as
  | the aliases are "lazy" loaded so they don't hinder performance.
  |
  */
  
  'aliases' =&gt; [
  
      'App' =&gt; Illuminate\Support\Facades\App::class,
      'Artisan' =&gt; Illuminate\Support\Facades\Artisan::class,
      'Auth' =&gt; Illuminate\Support\Facades\Auth::class,
      'Blade' =&gt; Illuminate\Support\Facades\Blade::class,
      'Bus' =&gt; Illuminate\Support\Facades\Bus::class,
      'Cache' =&gt; Illuminate\Support\Facades\Cache::class,
      'ClassLoader'=&gt; Illuminate\Support\ClassLoader::class,
      'Config' =&gt; Illuminate\Support\Facades\Config::class,
      'Cookie' =&gt; Illuminate\Support\Facades\Cookie::class,
      'Crypt' =&gt; Illuminate\Support\Facades\Crypt::class,
      'DB' =&gt; Illuminate\Support\Facades\DB::class,
      'Eloquent' =&gt; Illuminate\Database\Eloquent\Model::class,
      'Event' =&gt; Illuminate\Support\Facades\Event::class,
      'File' =&gt; Illuminate\Support\Facades\File::class,
      'Gate' =&gt; Illuminate\Support\Facades\Gate::class,
      'Hash' =&gt; Illuminate\Support\Facades\Hash::class,
      'Lang' =&gt; Illuminate\Support\Facades\Lang::class,
      'Log' =&gt; Illuminate\Support\Facades\Log::class,
      'Mail' =&gt; Illuminate\Support\Facades\Mail::class,
      'Notification' =&gt; Illuminate\Support\Facades\Notification::class,
      'Password' =&gt; Illuminate\Support\Facades\Password::class,
      'Queue' =&gt; Illuminate\Support\Facades\Queue::class,
      'Redirect' =&gt; Illuminate\Support\Facades\Redirect::class,
      'Redis' =&gt; Illuminate\Support\Facades\Redis::class,
      'Request' =&gt; Illuminate\Support\Facades\Request::class,
      'Response' =&gt; Illuminate\Support\Facades\Response::class,
      'Route' =&gt; Illuminate\Support\Facades\Route::class,
      'Schema' =&gt; Illuminate\Support\Facades\Schema::class,
      'Session' =&gt; Illuminate\Support\Facades\Session::class,
      'Storage' =&gt; Illuminate\Support\Facades\Storage::class,
      'URL' =&gt; Illuminate\Support\Facades\URL::class,
      'Validator' =&gt; Illuminate\Support\Facades\Validator::class,
      'View' =&gt; Illuminate\Support\Facades\View::class,
      'Form' =&gt; Collective\Html\FormFacade::class,
      'Html' =&gt; Collective\Html\HtmlFacade::class,
      'HTML' =&gt; Collective\Html\HtmlFacade::class,
      'Format' =&gt; NoHasl\Format::class,
      'GeoIP' =&gt; NoHasl\GeoIP::class,
      'Input' =&gt; Illuminate\Support\Facades\Input::class,
  
  ],
  </code></pre>
  
  <p>];</p>