Skip to content

Commit f601d0a

Browse files
committed
refactor: extract config handling methods
1 parent 13d40e7 commit f601d0a

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

src/Providers/SkeletonServiceProvider.php

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,26 @@ class SkeletonServiceProvider extends ServiceProvider
88
{
99
public function boot(): void
1010
{
11-
$this->publishes([
12-
dirname(__DIR__, 2).'/config/skeleton.php' => config_path('skeleton.php'),
13-
], 'config');
11+
$this->publishConfig();
1412
}
1513

1614
public function register(): void
15+
{
16+
$this->registerConfig();
17+
}
18+
19+
// Boot methods :
20+
private function publishConfig(): void
21+
{
22+
if ($this->app->runningInConsole()) {
23+
$this->publishes([
24+
dirname(__DIR__, 2).'/config/skeleton.php' => config_path('skeleton.php'),
25+
], 'config');
26+
}
27+
}
28+
29+
// Register methods :
30+
private function registerConfig(): void
1731
{
1832
$this->mergeConfigFrom(dirname(__DIR__, 2).'/config/skeleton.php', 'skeleton');
1933
}

0 commit comments

Comments
 (0)