title: Issue Running php artisan optimize
body: <p>I'm having an issue with my Laravel 5.2 application. I tried to install my repository to Forge, and I kept getting an "Invalid filename provided" error that is preventing the install from completing.</p>
  
  <p>To mimic this on my local machine, I changed my .env file to production mode and ran <code>php artisan optimize</code>, which is where the Forge install is getting stuck. I get the same error, and here is the output from my laravel.log file.</p>
  
  <pre><code>[2016-06-10 03:14:39] local.ERROR: RuntimeException: Invalid filename provided. in /{{ APP_PATH }}/vendor/classpreloader/classpreloader/src/ClassPreloader.php:114
  Stack trace:
  #0 /{{ APP_PATH }}/vendor/laravel/framework/src/Illuminate/Foundation/Console/OptimizeCommand.php(83): ClassPreloader\ClassPreloader-&gt;getCode(false, false)
  #1 /{{ APP_PATH }}/vendor/laravel/framework/src/Illuminate/Foundation/Console/OptimizeCommand.php(64): Illuminate\Foundation\Console\OptimizeCommand-&gt;compileClasses()
  #2 [internal function]: Illuminate\Foundation\Console\OptimizeCommand-&gt;fire()
  #3 /{{ APP_PATH }}/vendor/laravel/framework/src/Illuminate/Container/Container.php(507): call_user_func_array(Array, Array)
  #4 /{{ APP_PATH }}/vendor/laravel/framework/src/Illuminate/Console/Command.php(169): Illuminate\Container\Container-&gt;call(Array)
  #5 /{{ APP_PATH }}/vendor/symfony/symfony/src/Symfony/Component/Console/Command/Command.php(259): Illuminate\Console\Command-&gt;execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
  #6 /{{ APP_PATH }}/vendor/laravel/framework/src/Illuminate/Console/Command.php(155): Symfony\Component\Console\Command\Command-&gt;run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
  #7 /{{ APP_PATH }}/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php(844): Illuminate\Console\Command-&gt;run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
  #8 /{{ APP_PATH }}/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php(192): Symfony\Component\Console\Application-&gt;doRunCommand(Object(Illuminate\Foundation\Console\OptimizeCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
  #9 /{{ APP_PATH }}/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php(123): Symfony\Component\Console\Application-&gt;doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
  #10 /{{ APP_PATH }}/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(107): Symfony\Component\Console\Application-&gt;run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
  #11 /{{ APP_PATH }}/artisan(35): Illuminate\Foundation\Console\Kernel-&gt;handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
  #12 {main}  
  </code></pre>
  
  <p>My <code>config/compile.php</code> file has nothing in the <code>files</code> or <code>providers</code> arrays. The scripts section of my composer.json is updated to the current version. Here is my whole composer.json file:</p>
  
  <pre><code>{
      "name": "laravel/laravel",
      "description": "The Laravel Framework.",
      "keywords": ["framework", "laravel"],
      "license": "MIT",
      "type": "project",
      "require": {
          "php": "&gt;=5.5.9",
          "laravel/framework": "5.2.*",
          "authorizenet/authorizenet": "^1.8",
          "inacho/php-credit-card-validator": "^1.0",
          "geoip2/geoip2": "^2.3",
          "doctrine/dbal": "^2.5",
          "laravelcollective/html": "^5.1",
          "pingdevelopment/usps-php-api": "@dev",
          "barryvdh/laravel-debugbar": "^2.0",
          "mobiledetect/mobiledetectlib": "^2.8",
          "phpmd/phpmd": "^2.3",
          "ext-curl": "*",
          "jms/serializer": "xsd2php-dev as 0.18.0",
          "barryvdh/laravel-dompdf": "^0.6.1",
          "easypost/easypost-php": "^3.0"
      },
      "repositories": [{
            "type": "vcs",
            "url": "https://github.com/goetas/serializer.git"
        }],
      "require-dev": {
          "fzaninotto/faker": "~1.4",
          "mockery/mockery": "0.9.*",
          "phpunit/phpunit": "~4.0",
          "phpspec/phpspec": "~2.1",
          "goetas/xsd2php": "2.*@dev",
          "goetas/xsd-reader": "2.*@dev",
          "symfony/dom-crawler": "~3.0",
          "symfony/css-selector": "~3.0"
      },
      "autoload": {
          "classmap": [
              "database"
          ],
          "psr-4": {
              "App\\": "app/",
              "{{ APP NAME }}\\": "app/{{ APP NAME }}"
          }
      },
      "autoload-dev": {
          "classmap": [
              "tests/TestCase.php"
          ]
      },
      "scripts": {
          "post-root-package-install": [
              "php -r \"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 optimize"
          ]
      },
      "config": {
          "preferred-install": "dist"
      }
  }
  </code></pre>
  
  <p>I'm really lost here.</p>