Skip to content

Commit

Permalink
application version
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardokum committed Nov 28, 2023
1 parent 8eba77a commit 70ae287
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/Embedder/AttachmentEmbedder.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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', '>=');
}
}
3 changes: 2 additions & 1 deletion src/ServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
Expand Down

0 comments on commit 70ae287

Please sign in to comment.