| Conditions | 3 |
| Paths | 2 |
| Total Lines | 14 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 41 | protected function registerAuditingServiceProvider() |
||
| 42 | { |
||
| 43 | $namespace = Str::replaceLast('\\', '', app()->getNamespace()); |
||
|
|
|||
| 44 | |||
| 45 | $appConfig = file_get_contents(config_path('app.php')); |
||
| 46 | |||
| 47 | if (! $appConfig || Str::contains($appConfig, 'OwenIt\\Auditing\\AuditingServiceProvider::class')) { |
||
| 48 | return; |
||
| 49 | } |
||
| 50 | |||
| 51 | file_put_contents(config_path('app.php'), str_replace( |
||
| 52 | "{$namespace}\\Providers\EventServiceProvider::class," . PHP_EOL, |
||
| 53 | "{$namespace}\\Providers\EventServiceProvider::class," . PHP_EOL . " OwenIt\Auditing\AuditingServiceProvider::class," . PHP_EOL, |
||
| 54 | $appConfig |
||
| 55 | )); |
||
| 58 |