title: Laravel Class 'App\Modules\ServiceProvider' not found?
body: <p>Hello Friends I am new in Laravel framework.</p>
  
  <p>i create modules directory in app folder.</p>
  
  <p>then i also create ServiceProvider.php file in modules directory.</p>
  
  <p>my file structure like.</p>
  
  <pre><code>app\modules\ServiceProvider.php
  </code></pre>
  
  <p>This is code of ServiceProvider.php.</p>
  
  <pre><code>&lt;?php 
  namespace App\Modules;
  
  abstract class ServiceProvider extends \Illuminate\Support\ServiceProvider {
  
  public function boot() {
      if ($module = $this-&gt;getModule(func_get_args())) {
          $this-&gt;package("app/" . $module, $module, app_path() . "/modules/" . $module);
      }
  }
  
  public function register() {
  
      if ($module = $this-&gt;getModule(func_get_args())) {
          $this-&gt;app["config"]-&gt;package("app/" . $module, app_path() . "/modules/" . $module . "/config");
  
          // Add routes
          $routes = app_path() . "/modules/" . $module . "/routes.php";
          if (file_exists($routes))
          require $routes;
      }
  }
  
  public function getModule($args) {
      $module = (isset($args[0]) and is_string($args[0])) ? $args[0] : null;
      return $module;
  }
  
  }
  </code></pre>
  
  <p>Then i create a new points directory in modules directory.</p>
  
  <p>and also create ServiceProvider.php file in points directory.</p>
  
  <p>This is ServiceProvider.php file code.</p>
  
  <pre><code>&lt;?php
  
  namespace App\Modules\Points;
  
  class ServiceProvider extends \App\Modules\ServiceProvider {
  
  public function register() {
  parent::register("points");
  }
  
  public function boot() {
  parent::boot("points");
  }
  
  }
  </code></pre>
  
  <p>Then now i try to load project i got error like.</p>
  
  <pre><code>Class 'App\Modules\ServiceProvider' not found 
  
   Symfony\Component\Debug\Exception\FatalErrorException
  …/­app/­modules/­points/­ServiceProvider.php5 
  </code></pre>
  
  <p>i also add autoload entery in composer.json file like.</p>
  
  <pre><code>"autoload": {
    "classmap": [
      "app/modules"
     ]
   },
  </code></pre>
  
  <p>Then also run this command.</p>
  
  <pre><code>composer dump-autoload
  </code></pre>
  
  <p>but then after is not work.</p>
  
  <p>i also register my ServiceProvide in app.php like.</p>
  
  <pre><code>'providers' =&gt; array(
         'App\Modules\Points\ServiceProvider'
   ),
  </code></pre>
  
  <p>please tell where i doing a mistake.</p>
  
  <p>thank you.</p>