/**
  * Register the service provider.
  *
  * @return void
  */
 public function register()
 {
     $this->app->bindShared('analogue', function ($app) {
         $db = $app['db'];
         $connectionProvider = new IlluminateConnectionProvider($db);
         $illuminate = new IlluminateDriver($connectionProvider);
         $driverManager = new DriverManager();
         $driverManager->addDriver($illuminate);
         $event = $app->make('events');
         return new Manager($driverManager, $event);
     });
 }
Ejemplo n.º 2
0
 /**
  * Boot Analogue
  *
  * @return Analogue
  */
 public function boot()
 {
     if (static::$booted) {
         return $this;
     }
     $dispatcher = new Dispatcher();
     $connectionProvider = new CapsuleConnectionProvider(static::$capsule);
     $illuminate = new IlluminateDriver($connectionProvider);
     $driverManager = new DriverManager();
     $driverManager->addDriver($illuminate);
     static::$manager = new Manager($driverManager, $dispatcher);
     static::$instance = $this;
     static::$booted = true;
     return $this;
 }