Skip to content

Commit 11634b4

Browse files
Move adding view namespace to boot method
1 parent bd9ec9a commit 11634b4

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/HeloLaravelServiceProvider.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ public function boot()
2626
Mail::swap($instance);
2727

2828
app()->instance(MailerContract::class, $instance);
29+
30+
if ($this->app->runningInConsole()) {
31+
View::addNamespace('helo', __DIR__ . '/../resources/views');
32+
}
2933
}
3034

3135
/**
@@ -37,9 +41,7 @@ public function register()
3741
$this->commands([
3842
TestMailCommand::class,
3943
]);
40-
41-
View::addNamespace('helo', __DIR__ . '/../resources/views');
42-
44+
4345
$this->publishes([
4446
__DIR__.'/../config/helo.php' => base_path('config/helo.php'),
4547
], 'config');

0 commit comments

Comments
 (0)