diff --git a/src/Embedder/AttachmentEmbedder.php b/src/Embedder/AttachmentEmbedder.php index 212ba9c..9db2512 100755 --- a/src/Embedder/AttachmentEmbedder.php +++ b/src/Embedder/AttachmentEmbedder.php @@ -4,6 +4,7 @@ use Eduardokum\LaravelMailAutoEmbed\Models\EmbeddableEntity; use Exception; +use Illuminate\Foundation\Application; use Illuminate\Support\Str; use Swift_EmbeddedFile; use Swift_Message; @@ -160,6 +161,6 @@ protected function embed($body, $name, $type) */ private function isLaravel9() { - return version_compare(app()->version(), '9.0.0', '>='); + return version_compare(Application::VERSION, '9.0.0', '>='); } } diff --git a/src/ServiceProvider.php b/src/ServiceProvider.php index e74170f..d9919fa 100755 --- a/src/ServiceProvider.php +++ b/src/ServiceProvider.php @@ -4,6 +4,7 @@ use Eduardokum\LaravelMailAutoEmbed\Listeners\SwiftEmbedImages; use Eduardokum\LaravelMailAutoEmbed\Listeners\SymfonyEmbedImages; +use Illuminate\Foundation\Application; use Illuminate\Mail\Events\MessageSending; use Illuminate\Support\Arr; use Illuminate\Support\Facades\Event; @@ -21,7 +22,7 @@ class ServiceProvider extends BaseServiceProvider public function boot() { $this->publishes([$this->getConfigPath() => config_path('mail-auto-embed.php')], 'config'); - if (version_compare(app()->version(), '9.0.0', '>=')) { + if (version_compare(Application::VERSION, '9.0.0', '>=')) { Event::listen(function (MessageSending $event) { (new SymfonyEmbedImages($this->app['config']->get('mail-auto-embed'))) ->beforeSendPerformed($event);