/**
  * Bootstrap the application events.
  */
 public function boot()
 {
     //Registers the new Auth Provider
     \Auth::extend('multilogin', function ($app) {
         return new MultisourceDriver(SourceFactory::generateConfiguration());
     });
     //Enables the config copy from the Base Config File
     $this->publishes([__DIR__ . DIRECTORY_SEPARATOR . 'Config' . DIRECTORY_SEPARATOR . 'multisource.php' => config_path('multisource.php')]);
 }
 /**
  * Contructor. Initializes variables and loads the enabled sources
  * using the source factory.
  */
 public function __construct($configuration)
 {
     //Load the configuration
     $this->configuration = $configuration;
     //first we create the model
     $this->model = $this->createModel(\Config::get('auth.model'));
     //Now we process the configuration and initialize the correct sources
     $this->enabledSources = SourceFactory::buildSources($this->model);
 }