PaystackLiteServiceProvider::boot()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 11
rs 9.9
c 0
b 0
f 0
cc 2
nc 2
nop 0
1
<?php
2
3
namespace Stephenjude\PaystackLite;
4
5
use Illuminate\Support\ServiceProvider;
6
use Stephenjude\PaystackLite\Blade\PaystackBladeDirective;
7
8
class PaystackLiteServiceProvider extends ServiceProvider
9
{
10
    /**
11
     * Bootstrap the application services.
12
     */
13
    public function boot()
14
    {
15
16
        if ($this->app->runningInConsole()) {
17
            $this->publishes([
18
                __DIR__ . '/../config/paystack-lite.php' => config_path('paystack-lite.php'),
19
            ], 'config');
20
        }
21
22
        PaystackBladeDirective::register();
23
    }
24
25
    /**
26
     * Register the application services.
27
     */
28
    public function register()
29
    {
30
        // Automatically apply the package configuration
31
        $this->mergeConfigFrom(__DIR__ . '/../config/paystack-lite.php', 'paystack-lite');
32
33
        // Register the main class to use with the facade
34
        $this->app->singleton('paystack-lite', function () {
35
            return new PaystackLite;
36
        });
37
    }
38
}
39