| Total Complexity | 5 |
| Total Lines | 54 |
| Duplicated Lines | 0 % |
| Changes | 3 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 7 | class TrackingServiceProvider extends ServiceProvider |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * Bootstrap any Tracking services. |
||
| 11 | * |
||
| 12 | * @return void |
||
| 13 | */ |
||
| 14 | public function boot() |
||
| 15 | { |
||
| 16 | // Publish config file (before migrations in case config values are used in migrations) |
||
| 17 | $this->publishes([ |
||
| 18 | __DIR__.'/../../config/tracking.php' => config_path('tracking.php'), |
||
| 19 | ], 'config'); |
||
| 20 | |||
| 21 | // `TrackActivity` migration file |
||
| 22 | if (! class_exists('CreateTrackActionTable')) { |
||
| 23 | $this->publishes([ |
||
| 24 | __DIR__.'/../database/migrations/create_track_action_table.php.stub' => database_path( |
||
| 25 | 'migrations/'.date('Y_m_d_His', time()).'_create_track_action_table.php' |
||
| 26 | ), |
||
| 27 | ], 'migration'); |
||
| 28 | } |
||
| 29 | |||
| 30 | // `TrackAction` migration file |
||
| 31 | if (! class_exists('CreateTrackActivityTable')) { |
||
| 32 | $this->publishes([ |
||
| 33 | __DIR__.'/../database/migrations/create_track_activity_table.php.stub' => database_path( |
||
| 34 | 'migrations/'.date('Y_m_d_His', time()).'_create_track_activity_table.php' |
||
| 35 | ), |
||
| 36 | ], 'migration'); |
||
| 37 | } |
||
| 38 | |||
| 39 | // `TrackTraffic` migration file |
||
| 40 | if (! class_exists('CreateTrackTrafficTable')) { |
||
| 41 | $this->publishes([ |
||
| 42 | __DIR__.'/../database/migrations/create_track_traffic_table.php.stub' => database_path( |
||
| 43 | 'migrations/'.date('Y_m_d_His', time()).'_create_track_traffic_table.php' |
||
| 44 | ), |
||
| 45 | ], 'migration'); |
||
| 46 | } |
||
| 47 | } |
||
| 48 | |||
| 49 | /** |
||
| 50 | * Register any Tracking services. |
||
| 51 | * |
||
| 52 | * @return void |
||
| 53 | */ |
||
| 54 | public function register() |
||
| 61 | } |
||
| 62 | } |
||
| 63 |