PaystackWebhooksServiceProvider::boot()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 5
rs 10
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