diff --git a/src/Githook.php b/src/Githook.php deleted file mode 100644 index f8c474a..0000000 --- a/src/Githook.php +++ /dev/null @@ -1,8 +0,0 @@ -loadRoutesFrom(__DIR__.'/../routes/web.php'); if ($this->app->runningInConsole()) { - - $this->publishes( - [ - __DIR__.'/../config/config.php' => config_path('githook.php'), - ], - 'config' - ); - - // Publishing the views. - $this->publishes( - [ - __DIR__.'/../resources/views' => resource_path('views/vendor/githook'), - ], - 'views' - ); + $this->bootForConsole(); } } @@ -43,15 +29,26 @@ public function register() $this->app->register(EventServiceProvider::class); $this->app->make(GithookController::class); - // Automatically apply the package configuration $this->mergeConfigFrom(__DIR__.'/../config/config.php', 'githook'); - // Register the main class to use with the facade - $this->app->singleton( - 'githook', - function () { - return new Githook; - } - ); + $this->app->singleton('githook', function () { + return new Githook; + }); + } + + /** + * Console-specific booting. + * + * @return void + */ + protected function bootForConsole(): void + { + $this->publishes([ + __DIR__.'/../config/config.php' => config_path('githook.php'), + ], 'config'); + + $this->publishes([ + __DIR__.'/../resources/views' => resource_path('views/vendor/githook'), + ], 'views'); } } diff --git a/src/Mail/Githook.php b/src/Mail/Githook.php index ff0bf85..59c2940 100644 --- a/src/Mail/Githook.php +++ b/src/Mail/Githook.php @@ -3,7 +3,6 @@ namespace Digitlimit\Githook\Mail; use Illuminate\Bus\Queueable; -use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Mail\Mailable; use Illuminate\Queue\SerializesModels;