Skip to content

Commit 9a3b18a

Browse files
zupolgecfedeisas
andauthored
Laravel 7 compatibility (#72)
* Allow installation with Laravel 7 * Fixed registration for Laravel 7 compatibility * Fixed Laravel version requirements * Removed incompatible PHP version from CI tests Co-authored-by: Fede Isas <[email protected]>
1 parent e241177 commit 9a3b18a

File tree

3 files changed

+5
-13
lines changed

3 files changed

+5
-13
lines changed

.travis.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,6 @@ language: php
33

44
matrix:
55
include:
6-
- php: 5.6
7-
dist: xenial
8-
- php: 7.0
9-
dist: xenial
10-
- php: 7.1
11-
dist: bionic
126
- php: 7.2
137
dist: bionic
148
- php: 7.3

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
],
1212
"require": {
1313
"php": ">=5.4.0",
14-
"illuminate/support": "~5.0|^6.0|^7.0",
14+
"illuminate/support": "^7.0",
1515
"tijsverkoyen/css-to-inline-styles": "~2.0"
1616
},
1717
"require-dev" : {

src/LaravelMailCssInlinerServiceProvider.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
<?php namespace Fedeisas\LaravelMailCssInliner;
22

3+
use Illuminate\Mail\MailManager;
34
use Illuminate\Support\ServiceProvider;
4-
use Swift_Mailer;
5-
use Fedeisas\LaravelMailCssInliner\CssInlinerPlugin;
65

76
class LaravelMailCssInlinerServiceProvider extends ServiceProvider
87
{
@@ -31,10 +30,9 @@ public function register()
3130
return new CssInlinerPlugin($app['config']->get('css-inliner'));
3231
});
3332

34-
$this->app->extend('swift.mailer', function (Swift_Mailer $swiftMailer, $app) {
35-
$inlinerPlugin = $app->make(CssInlinerPlugin::class);
36-
$swiftMailer->registerPlugin($inlinerPlugin);
37-
return $swiftMailer;
33+
$this->app->extend('mail.manager', function (MailManager $mailManager) {
34+
$mailManager->getSwiftMailer()->registerPlugin($this->app->make(CssInlinerPlugin::class));
35+
return $mailManager;
3836
});
3937
}
4038
}

0 commit comments

Comments
 (0)