Skip to content

Commit d29cdb4

Browse files
author
Mark van den Broek
committed
Add support for Laravel 5.5.
1 parent 7e23725 commit d29cdb4

File tree

5 files changed

+26
-22
lines changed

5 files changed

+26
-22
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
## [Unreleased]
44

5+
### Updated
6+
- Added support for Laravel 5.5.
7+
58
## [2.0.0]
69

710
### Added

README.md

+1-7
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,7 @@ $ composer require coconutcraig/laravel-postmark
1919

2020
## Usage
2121

22-
After updating composer, add the PostmarkServiceProvider to the providers array in `config/app.php`
23-
24-
``` php
25-
Coconuts\Mail\PostmarkServiceProvider::class,
26-
```
27-
28-
Next we will need to update the `config/services.php` file to hold our Postmark specific config.
22+
Update the `config/services.php` file to hold our Postmark specific config.
2923

3024
```php
3125
return [

composer.json

+14-7
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@
1717
}
1818
],
1919
"require": {
20-
"php": "~7.0",
20+
"php": ">=7.0",
2121
"guzzlehttp/guzzle": "~6.0",
22-
"illuminate/mail": "~5.4",
23-
"illuminate/support": "~5.4"
22+
"illuminate/mail": "~5.5",
23+
"illuminate/support": "~5.5"
2424
},
2525
"require-dev": {
26-
"orchestra/testbench": "~3.4",
27-
"phpunit/phpunit": "~5.0",
28-
"squizlabs/php_codesniffer": "^2.3"
26+
"orchestra/testbench": "~3.5",
27+
"phpunit/phpunit": "^6.2",
28+
"squizlabs/php_codesniffer": "^3.0"
2929
},
3030
"autoload": {
3131
"psr-4": {
@@ -45,9 +45,16 @@
4545
"extra": {
4646
"branch-alias": {
4747
"dev-master": "2.0-dev"
48+
},
49+
"laravel": {
50+
"providers": [
51+
"Coconuts\\Mail\\PostmarkServiceProvider"
52+
]
4853
}
4954
},
5055
"config": {
5156
"sort-packages": true
52-
}
57+
},
58+
"minimum-stability": "dev",
59+
"prefer-stable": true
5360
}

src/PostmarkTransport.php

+7-7
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace Coconuts\Mail;
44

55
use Swift_Attachment;
6-
use Swift_Mime_Message;
6+
use Swift_Mime_SimpleMessage;
77
use GuzzleHttp\ClientInterface;
88
use Illuminate\Mail\Transport\Transport;
99

@@ -50,12 +50,12 @@ public function __construct(ClientInterface $client, $key)
5050
* Recipient/sender data will be retrieved from the Message API.
5151
* The return value is the number of recipients who were accepted for delivery.
5252
*
53-
* @param Swift_Mime_Message $message
53+
* @param Swift_Mime_SimpleMessage $message
5454
* @param string[] $failedRecipients An array of failures by-reference
5555
*
5656
* @return int
5757
*/
58-
public function send(Swift_Mime_Message $message, &$failedRecipients = null)
58+
public function send(Swift_Mime_SimpleMessage $message, &$failedRecipients = null)
5959
{
6060
$this->beforeSendPerformed($message);
6161

@@ -74,11 +74,11 @@ public function send(Swift_Mime_Message $message, &$failedRecipients = null)
7474
/**
7575
* Get all attachments for the given message.
7676
*
77-
* @param \Swift_Mime_Message $message
77+
* @param \Swift_Mime_SimpleMessage $message
7878
*
7979
* @return array
8080
*/
81-
protected function getAttachments(Swift_Mime_Message $message)
81+
protected function getAttachments(Swift_Mime_SimpleMessage $message)
8282
{
8383
$attachments = [];
8484

@@ -123,7 +123,7 @@ protected function getContacts($contacts)
123123
*
124124
* @return string
125125
*/
126-
protected function getFrom(Swift_Mime_Message $message)
126+
protected function getFrom(Swift_Mime_SimpleMessage $message)
127127
{
128128
return collect($message->getFrom())
129129
->map(function ($display, $address) {
@@ -155,7 +155,7 @@ protected function getMessageId($response)
155155
*
156156
* @return array
157157
*/
158-
protected function payload(Swift_Mime_Message $message)
158+
protected function payload(Swift_Mime_SimpleMessage $message)
159159
{
160160
$headers = $message->getHeaders();
161161

tests/PostmarkTransportTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function setUp()
2626
{
2727
parent::setUp();
2828

29-
$attachment = \Swift_Attachment::newInstance('test attachment', 'test.txt');
29+
$attachment = new \Swift_Attachment('test attachment', 'test.txt');
3030
$attachment->setContentType('text/plain');
3131
$message = new \Swift_Message('Foo subject', 'Bar body');
3232
$message->setFrom('[email protected]');

0 commit comments

Comments
 (0)