Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
mauricius committed Nov 19, 2022
2 parents 33eeef8 + 45a7a4b commit 2bd3eb4
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions src/LaravelHtmxServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ class LaravelHtmxServiceProvider extends ServiceProvider
{
public function boot()
{
$this->publishes([
__DIR__.'/../config/laravel-htmx.php' => config_path('laravel-htmx.php'),
], 'config');
if ($this->app->runningInConsole()) {
$this->bootForConsole();
}

$this->app['blade.compiler']->directive('fragment', function () {
return '';
Expand All @@ -31,6 +31,18 @@ public function boot()
return BladeFragment::render($view, $fragment, $data);
});
}

/**
* Console-specific booting.
*
* @return void
*/
protected function bootForConsole()
{
$this->publishes([
__DIR__.'/../config/laravel-htmx.php' => config_path('laravel-htmx.php'),
], 'config');
}

public function register()
{
Expand Down

0 comments on commit 2bd3eb4

Please sign in to comment.