Skip to content

Commit a3e045e

Browse files
Merge pull request #72 from MarcinOrlowski/autodiscovery
Add support for Laravel 5.5's auto-discovery feature
2 parents 8e17c6e + 863b720 commit a3e045e

File tree

6 files changed

+57
-6
lines changed

6 files changed

+57
-6
lines changed

.travis.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
##################################################################################
22
#
3-
# Laravel API Response Builder
3+
# Laravel API Response Builder Travis CI config file
44
#
55
# @package MarcinOrlowski\ResponseBuilder
66
#
@@ -18,28 +18,36 @@ php:
1818
- 5.6
1919
- 7.0
2020
- 7.1
21+
- 7.2
2122
- hhvm
2223

2324
env:
2425
- LARAVEL_VERSION="5.1"
2526
- LARAVEL_VERSION="5.2"
2627
- LARAVEL_VERSION="5.3"
2728
- LARAVEL_VERSION="5.4"
29+
- LARAVEL_VERSION="5.5"
2830

2931
matrix:
3032
exclude:
3133
- php: 5.5
3234
env: LARAVEL_VERSION="5.3"
3335
- php: 5.5
3436
env: LARAVEL_VERSION="5.4"
37+
- php: 5.5
38+
env: LARAVEL_VERSION="5.5"
39+
- php: 5.6
40+
env: LARAVEL_VERSION="5.5"
41+
- php: hhvm
42+
env: LARAVEL_VERSION="5.5"
3543

3644
cache:
3745
directories:
3846
- ${HOME}/.composer/cache/files
3947

4048
before_script:
4149
# Disable coverage (hhvm does not feature xdebug)
42-
- if [ $TRAVIS_PHP_VERSION != hhvm ] ; then phpenv config-rm xdebug.ini ; fi
50+
- if [ ${TRAVIS_PHP_VERSION} != hhvm && ${TRAVIS_PHP_VERSION} != 7.2 ] ; then phpenv config-rm xdebug.ini ; fi
4351
- cp -f "travis/composer-${LARAVEL_VERSION}.json" composer.json
4452
- FLAGS="--prefer-dist"
4553
- composer install ${FLAGS}

CHANGES.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ See [compatibility docs](docs/compatibility.md) for details about backward compa
44

55
## CHANGE LOG ##
66

7+
* v4.1.0 (2017-09-09)
8+
* Added support for Laravel 5.5's auto-discovery feature
9+
710
* v4.0.2 (2017-04-13)
811
* Enforced HTTP code for error messages fits 400-499 range
912
* `validateResponseStructure()` deprecated in favor of `assertValidResponse()`

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,9 @@ then then feel free to donate to the project. Send some Bitcoins (BTC) to `1Lbfb
4141

4242
* Easy to use,
4343
* [Stable and production ready](https://travis-ci.org/MarcinOrlowski/laravel-api-response-builder),
44-
* Laravel 5.x, 5.2, 5.3 and 5.4 compatible,
45-
* Works on PHP 5.5, 5.6, 7.0, 7.1 and [HHVM](http://hhvm.com/),
44+
* Laravel 5.x, 5.2, 5.3, 5.4 and 5.5 compatible,
45+
* Supports Laravel 5.5's auto-discovery feature
46+
* Works on PHP 5.5, 5.6, 7.0, 7.1, 7.2 and [HHVM](http://hhvm.com/),
4647
* Configurable (with ready-to-use defaults),
4748
* Localization support,
4849
* Automatic object conversion with custom mapping,

composer.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@
2222
"source": "https://github.com/MarcinOrlowski/laravel-api-response-builder/",
2323
"issues": "https://github.com/MarcinOrlowski/laravel-api-response-builder/issues"
2424
},
25+
"extra": {
26+
"laravel": {
27+
"providers": [
28+
"MarcinOrlowski\\ResponseBuilder\\ResponseBuilderServiceProvider"
29+
]
30+
}
31+
},
2532
"require": {
2633
"php": ">=5.5.9",
2734
"laravel/framework": "^5.1"

docs/docs.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -393,12 +393,20 @@ and tweak this file according to your needs. If you are fine with defaults, this
393393
can safely be skipped (you can also remove published `config/response_builder.php` file).
394394

395395

396-
#### Laravel setup ####
396+
#### Laravel 5.5+ setup ####
397397

398-
Edit `app/config.php` and add the following line to your `providers` array:
398+
`ResponseBuilder` supports Laravel 5.5's auto-discovery feature, so if you are using such
399+
version, you do not need to do much to make it work.
400+
401+
#### Laravel older than 5.5 ####
402+
403+
If you use Laravel 5.4 or older, then you need to manually register `ResponseBuilder` provider
404+
for Laravel to know about it existence. Edit `app/config.php` and add the following line to your
405+
`providers` array:
399406

400407
MarcinOrlowski\ResponseBuilder\ResponseBuilderServiceProvider::class,
401408

409+
402410
#### ApiCodes class ####
403411

404412
To keep your source readable and clear, it's strongly recommended to create separate class

travis/composer-5.5.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"name": "marcin-orlowski/laravel-api-response-builder",
3+
"require": {
4+
"php": ">=7.0"
5+
},
6+
"autoload": {
7+
"psr-4": {
8+
"MarcinOrlowski\\ResponseBuilder\\": "src"
9+
}
10+
},
11+
"autoload-dev": {
12+
"psr-4": {
13+
"MarcinOrlowski\\ResponseBuilder\\": "src",
14+
"MarcinOrlowski\\ResponseBuilder\\Tests\\": "tests"
15+
}
16+
},
17+
"require-dev": {
18+
"orchestra/testbench": "3.4.*",
19+
"laravel/framework": "5.4.*",
20+
"phpunit/phpunit": "~5.7",
21+
"phpunit/php-code-coverage": "^4.0.4",
22+
"codacy/coverage": "~1.0"
23+
}
24+
}

0 commit comments

Comments
 (0)