コード例 #1
0
 public function boot()
 {
     // configuration
     $this->mergeConfigFrom(__DIR__ . '/../config/webserver.php', 'webserver');
     $this->publishes([__DIR__ . '/../config/webserver.php' => config_path('webserver.php')], 'webserver-config');
     // adds views
     $this->loadViewsFrom(__DIR__ . '/../views', 'webserver');
     // migrations
     $this->publishes([__DIR__ . '/../database/migrations/' => database_path('/migrations')], 'migrations');
     Website::observe(new Observers\WebsiteObserver());
     SslCertificate::observe(new Observers\SslCertificateObserver());
     Hostname::observe(new Observers\HostnameObserver());
     /*
      * Ssl repository
      */
     $this->app->bind('Hyn\\Webserver\\Contracts\\SslRepositoryContract', function ($app) {
         return new SslRepository(new SslCertificate(), new SslHostname());
     });
     /*
      * Toolbox command
      */
     $this->app->bind('hyn.webserver.command.toolbox', function ($app) {
         return new Commands\ToolboxCommand($app->make(WebsiteRepositoryContract::class));
     });
     $this->commands(['hyn.webserver.command.toolbox']);
 }
コード例 #2
0
 /**
  * Registers model observers.
  */
 protected function observers()
 {
     Models\Website::observe(new Observers\WebsiteObserver());
     Models\Hostname::observe(new Observers\HostnameObserver());
     Models\Tenant::observe(new Observers\TenantObserver());
 }