Skip to content

Commit

Permalink
Support Laravel 5.8
Browse files Browse the repository at this point in the history
  • Loading branch information
staudenmeir committed May 22, 2019
1 parent ef8ca95 commit 0f60dee
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 11 deletions.
5 changes: 2 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@ env:

matrix:
include:
- php: 7.0
- php: 7.0
env: RELEASE=lowest
- php: 7.1
- php: 7.1
env: RELEASE=lowest
- php: 7.2
- php: 7.3
env: COVERAGE=yes
Expand Down
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,9 @@ DB::table('users')->insertIgnore(

### Eloquent

You can use UPSERT and INSERT IGNORE queries in Eloquent with the `HasUpsertQueries` trait:
You can use UPSERT and INSERT IGNORE queries with Eloquent models.

In Laravel 5.5–5.7, this requires the `HasUpsertQueries` trait:

```php
class User extends Model
Expand All @@ -134,4 +136,6 @@ If you are using Lumen, you have to instantiate the query builder manually:
$builder = new \Staudenmeir\LaravelUpsert\Query\Builder(app('db')->connection());

$builder->from(...)->upsert(...);
```
```

In Eloquent, the `HasUpsertQueries` trait is required for *all* versions of Lumen.
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
}
],
"require": {
"php": ">=7.0",
"illuminate/database": "5.5.*|5.6.*|5.7.*"
"php": "^7.1.3",
"illuminate/database": "5.8.*"
},
"require-dev": {
"laravel/homestead": "^7.0",
"orchestra/testbench": "^3.5"
"laravel/homestead": "^8.0",
"orchestra/testbench": "3.8.*"
},
"autoload": {
"psr-4": {
Expand Down
4 changes: 2 additions & 2 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

abstract class TestCase extends Base
{
protected function setUp()
protected function setUp(): void
{
parent::setUp();

Expand Down Expand Up @@ -48,7 +48,7 @@ protected function setUp()
Carbon::setTestNow(Carbon::now()->addSecond());
}

protected function tearDown()
protected function tearDown(): void
{
Carbon::setTestNow(null);

Expand Down

0 comments on commit 0f60dee

Please sign in to comment.