Skip to content

Commit

Permalink
chore: refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
digitlimit committed Nov 7, 2023
1 parent be7583e commit 86b4cd5
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 32 deletions.
8 changes: 0 additions & 8 deletions src/Githook.php

This file was deleted.

43 changes: 20 additions & 23 deletions src/GithookServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,7 @@ public function boot()
$this->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();
}
}

Expand All @@ -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');
}
}
1 change: 0 additions & 1 deletion src/Mail/Githook.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 86b4cd5

Please sign in to comment.