PaystackWebhooksServiceProvider   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 13
c 1
b 0
f 0
dl 0
loc 30
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A registerRoutes() 0 9 1
A register() 0 3 1
A registerPublishables() 0 5 1
A boot() 0 5 1
1
<?php
2
3
namespace Digikraaft\PaystackWebhooks;
4
5
use Illuminate\Support\Facades\Route;
6
use Illuminate\Support\ServiceProvider;
7
8
class PaystackWebhooksServiceProvider extends ServiceProvider
9
{
10
    public function boot()
11
    {
12
        $this->registerPublishables();
13
14
        $this->registerRoutes();
15
    }
16
17
    public function register()
18
    {
19
        $this->mergeConfigFrom(__DIR__.'/../config/paystackwebhooks.php', 'paystackwebhooks');
20
    }
21
22
    protected function registerPublishables(): void
23
    {
24
        $this->publishes([
25
            __DIR__.'/../config/paystackwebhooks.php' => config_path('paystackwebhooks.php'),
26
        ], 'config');
27
    }
28
29
    protected function registerRoutes()
30
    {
31
        //load routes for webhooks
32
        Route::group([
33
            'prefix' => config('paystackwebhooks.webhook_path'),
34
            'namespace' => 'Digikraaft\PaystackWebhooks\Http\Controllers',
35
            'as' => 'paystack.',
36
        ], function () {
37
            $this->loadRoutesFrom(__DIR__.'/../routes/web.php');
38
        });
39
    }
40
}
41