title: FatalErrorException in ProviderRepository.php line 146: Cannot instantiate abstract class App\Modules\ModuleServiceProvider
body: <p>I have used laravel 5.2 for my project.
  For a modular approach I have modules in app > modules, and in modules > user.</p>
  
  <p>module > ModuleServiceProvider.php is as below:</p>
  
  <pre><code>&lt;?php namespace App\Modules;
  
  use \Illuminate\Support\ServiceProvider as ServiceProvider;
  abstract class ModuleServiceProvider extends  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>?></p>
  
  <p>and my LeadServiceProvider.php is like</p>
  
  <pre><code>&lt;?php  namespace App\Modules\Lead;
  
   class LeadServiceProvider extends \App\Modules\ModuleServiceProvider {
  
  public function register()
  {
      parent::register("user");
  }
  
  public function boot()
  {
      parent::boot("user");
  }
  /**
   * Register any application services.
   *
   * @return void
   */
  
  
  }
  </code></pre>
  
  <p>i have written it in my app.php providers too</p>
  
  <p>like</p>
  
  <blockquote>
    <p>App\Modules\ModuleServiceProvider::class,
       App\Modules\Lead\LeadServiceProvider::class,</p>
  </blockquote>
  
  <p>Also written in composer.json too.</p>
  
  <p>but it gives error like </p>
  
  <blockquote>
    <p>FatalErrorException in ProviderRepository.php line 146:
      Cannot instantiate abstract class App\Modules\ModuleServiceProvider</p>
  </blockquote>