Skip to content

Commit 7f45330

Browse files
authored
Add Laravel 5.5 compatibility (spatie#109)
* prepare for laravel 5.5 release * commit * Apply fixes from StyleCI (spatie#103) * Fix NewsletterFacade getFacadeAccessor method. (spatie#106) * Update readme about auto-discovery (spatie#107) * update deps
1 parent 96c2e38 commit 7f45330

15 files changed

+77
-237
lines changed

.styleci.yml

-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
11
preset: laravel
2-
3-
linting: true

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
language: php
22

33
php:
4-
- 5.6
54
- 7.0
65
- 7.1
6+
- 7.2
77

88
before_script:
99
- travis_retry composer self-update

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
All notable changes to `laravel-newsletter` will be documented in this file
44

5+
## 4.0.0 - 2017-08-30
6+
7+
- added support for Laravel 5.5, dropped support for Laravel 5.4
8+
- renamed config file from `laravel-newsletter` to `newsletter`
9+
510
## 3.7.0 - 2017-07-12
611

712
- add `isSubscribed`

LICENSE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# The MIT License (MIT)
22

3-
Copyright (c) 2015 Freek Van der Herten <freek@spatie.be>
3+
Copyright (c) Spatie bvba <info@spatie.be>
44

55
> Permission is hereby granted, free of charge, to any person obtaining a copy
66
> of this software and associated documentation files (the "Software"), to deal

README.md

+11-34
Original file line numberDiff line numberDiff line change
@@ -66,32 +66,15 @@ composer require spatie/laravel-newsletter
6666

6767
You must also install this service provider.
6868

69-
```php
70-
// config/app.php
71-
'providers' => [
72-
...
73-
Spatie\Newsletter\NewsletterServiceProvider::class,
74-
...
75-
];
76-
```
77-
78-
If you want to make use of the facade you must install it as well.
79-
80-
```php
81-
// config/app.php
82-
'aliases' => [
83-
..
84-
'Newsletter' => Spatie\Newsletter\NewsletterFacade::class,
85-
];
86-
```
69+
The package will automatically register itself.
8770

8871
To publish the config file to `app/config/laravel-newsletter.php` run:
8972

9073
```bash
9174
php artisan vendor:publish --provider="Spatie\Newsletter\NewsletterServiceProvider"
9275
```
9376

94-
This will publish a file `laravel-newsletter.php` in your config directory with the following contents:
77+
This will publish a file `newsletter.php` in your config directory with the following contents:
9578
```php
9679
return [
9780

@@ -221,22 +204,16 @@ Newsletter::isSubscribed('lord.vetinari@discworld.com'); //returns a bool
221204

222205
### Creating a campaign
223206

224-
This is how you create a campaign:
207+
This the signature of `createCampaign`:
225208
```php
226-
/**
227-
* @param string $fromName
228-
* @param string $replyTo
229-
* @param string $subject
230-
* @param string $html
231-
* @param string $listName
232-
* @param array $options
233-
* @param array $contentOptions
234-
*
235-
* @return array|bool
236-
*
237-
* @throws \Spatie\Newsletter\Exceptions\InvalidNewsletterList
238-
*/
239-
public function createCampaign($fromName, $replyTo, $subject, $html = '', $listName = '', $options = [], $contentOptions = [])
209+
public function createCampaign(
210+
string $fromName,
211+
string $replyTo,
212+
string $subject,
213+
string $html = '',
214+
string $listName = '',
215+
array $options = [],
216+
array $contentOptions = [])
240217
```
241218

242219
Note the campaign will only be created, no mails will be sent out.

composer.json

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "spatie/laravel-newsletter",
3-
"description": "Manage newsletters in Laravel 5",
3+
"description": "Manage newsletters in Laravel",
44
"keywords": [
55
"laravel",
66
"newsletter",
@@ -17,12 +17,12 @@
1717
}
1818
],
1919
"require": {
20-
"php" : "~5.6|~7.0",
21-
"illuminate/support": "~5.1.0|~5.2.0|~5.3.0|~5.4.0",
20+
"php" : "~7.0",
21+
"illuminate/support": "~5.5.0",
2222
"drewm/mailchimp-api": "^2.4"
2323
},
2424
"require-dev": {
25-
"phpunit/phpunit" : "^5.0",
25+
"phpunit/phpunit" : "^6.3",
2626
"mockery/mockery": "^0.9.4"
2727
},
2828
"autoload": {
@@ -44,5 +44,7 @@
4444
"Newsletter": "Spatie\\Newsletter\\NewsletterFacade"
4545
}
4646
}
47-
}
47+
},
48+
"minimum-stability": "dev",
49+
"prefer-stable": true
4850
}
File renamed without changes.

0 commit comments

Comments
 (0)