NotificationsServiceProvider::boot()   A
last analyzed

Complexity

Conditions 3
Paths 4

Size

Total Lines 17

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 17
rs 9.7
c 0
b 0
f 0
cc 3
nc 4
nop 0
1
<?php
2
3
namespace Appvise\AppStoreNotifications;
4
5
use Illuminate\Support\ServiceProvider;
6
7
class NotificationsServiceProvider extends ServiceProvider
8
{
9
    public function boot()
10
    {
11
        if ($this->app->runningInConsole()) {
12
            $this->publishes([
13
                __DIR__.'/../config/appstore-server-notifications.php' => config_path('appstore-server-notifications.php'),
14
            ], 'config');
15
        }
16
17
        if (! class_exists('CreateAppleNotificationsTable')) {
18
            $timestamp = date('Y_m_d_His', time());
19
            $this->publishes([
20
                __DIR__.'/../database/migrations/create_apple_notifications_table.php.stub' => database_path("migrations/{$timestamp}_create_apple_notifications_table.php"),
21
            ], 'migrations');
22
        }
23
24
        $this->loadRoutesFrom(__DIR__.'/routes.php');
25
    }
26
27
    public function register()
28
    {
29
        $this->mergeConfigFrom(__DIR__.'/../config/appstore-server-notifications.php', 'appstore-server-notifications');
30
    }
31
}
32