title: PhpStorm autocompletes my class but I get Class not found in Laravel 5
body: <p>I've added my classes normally in Laravel below <code>app</code> directory. Today, when I added an API client that has a directory structure I can't make a class recognized in Laravel PSR-4 default structure.</p>
  
  <p>My API client directory structure is:</p>
  
  <pre><code>app -- MySubdirectory -- Partners +
                                    |- Partner1
                                    |- Partner2 +
                                                |- Includes -- (other subdirectories)
                                                |- Version -- (other subdirectories)
                                                |- ApiClient.php
  </code></pre>
  
  <p>Now, I've created a model MyModel that resides below app.</p>
  
  <pre><code>&lt;?php
  
  namespace App;
  
  use Illuminate\Database\Eloquent\Model;
  
  class MyModel extends Model
  {
      /**
       */
      protected $api;
  
      /**
       * Returns MyModel API Client connected to the API.
       */
      public function __construct()
      {
          parent::__construct();
  
          // ApiClient is not recognized thought PhpStorm do recognized.
          $this-&gt;api = \ApiClient::factory(PROTOCOL_JSON, VERSION_DEFAULT);
  
          $credentials = json_decode(OtherModel::where('name', 'some_name')-&gt;configuration);
  
          $this-&gt;api-&gt;setConnectId($credentials['connect_id']);
          $this-&gt;api-&gt;setSecretKey($credentials['secret_key']);
      }
  }
  </code></pre>
  
  <p>Well, when I've wrote MyModel in line</p>
  
  <pre><code>$this-&gt;api = \ApiClient::factory(PROTOCOL_JSON, VERSION_DEFAULT);
  </code></pre>
  
  <p>PhpStorm suggested that class, apparently recognizing an autoloaded class.</p>
  
  <p>But when I run the script I get error:</p>
  
  <pre><code>FatalThrowableError in MyModel.php line 20: 
  Class 'ApiClient' not found
  </code></pre>
  
  <p>Ok, maybe some problem with <code>composer autoload</code> - even until now other classes that I've been created where automatically recognized by <code>PHP</code>.</p>
  
  <p>So, I ran <code>composer dump-autoload -o</code> and verified <code>autoload_classmap.php</code> file and really all other subdirectories/classes below <code>app</code> directory are recognized, minus <code>MySubdirectory</code> and other subdirectories and classes below <code>MySubdirectory</code>.</p>
  
  <p>My composer.json file has the basic autoload section:</p>
  
  <pre><code>"autoload": {
      "classmap": [
          "database"
      ],
      "psr-4": {
          "App\\": "app/"
      }
  },
  </code></pre>
  
  <p>So, why running <code>composer dump-autoload</code> can't catch <code>MySubdirectory</code> and other subdirectories and classes below that?</p>
  
  <p>And why PhpStorm does catch <code>ApiClient.php</code>?</p>