Skip to content

Commit 45a7a4b

Browse files
authored
Merge pull request #1 from robertogallea/patch-1
Move configuration publishing to bootForConsole()
2 parents cff8490 + 816d9c1 commit 45a7a4b

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

src/LaravelHtmxServiceProvider.php

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ class LaravelHtmxServiceProvider extends ServiceProvider
1313
{
1414
public function boot()
1515
{
16-
$this->publishes([
17-
__DIR__.'/../config/laravel-htmx.php' => config_path('laravel-htmx.php'),
18-
], 'config');
16+
if ($this->app->runningInConsole()) {
17+
$this->bootForConsole();
18+
}
1919

2020
$this->app['blade.compiler']->directive('fragment', function () {
2121
return '';
@@ -31,6 +31,18 @@ public function boot()
3131
return BladeFragment::render($view, $fragment, $data);
3232
});
3333
}
34+
35+
/**
36+
* Console-specific booting.
37+
*
38+
* @return void
39+
*/
40+
protected function bootForConsole()
41+
{
42+
$this->publishes([
43+
__DIR__.'/../config/laravel-htmx.php' => config_path('laravel-htmx.php'),
44+
], 'config');
45+
}
3446

3547
public function register()
3648
{

0 commit comments

Comments
 (0)