Skip to content

Commit 3b001f6

Browse files
Merge pull request #24 from tylernathanreed/10.x
Laravel 10.x Support
2 parents 9436207 + cb390df commit 3b001f6

File tree

6 files changed

+22
-20
lines changed

6 files changed

+22
-20
lines changed

.github/workflows/coverage.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,18 @@ jobs:
1515

1616
steps:
1717
- name: Checkout code
18-
uses: actions/checkout@v2
18+
uses: actions/checkout@v3
1919

2020
- name: Setup PHP
2121
uses: shivammathur/setup-php@v2
2222
with:
23-
php-version: 8.0
23+
php-version: 8.1
2424
extensions: dom, curl, libxml, mbstring, zip, pdo, sqlite, pdo_sqlite, gd, xdebug
2525
tools: composer:v2
2626
coverage: xdebug
2727

2828
- name: Install dependencies
29-
uses: nick-invision/retry@v1
29+
uses: nick-invision/retry@v2
3030
with:
3131
timeout_minutes: 5
3232
max_attempts: 2

.github/workflows/style.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,18 @@ jobs:
1515

1616
steps:
1717
- name: Checkout code
18-
uses: actions/checkout@v2
18+
uses: actions/checkout@v3
1919

2020
- name: Setup PHP
2121
uses: shivammathur/setup-php@v2
2222
with:
23-
php-version: 8.0
23+
php-version: 8.1
2424
extensions: dom, curl, libxml, mbstring, zip, pdo, sqlite, pdo_sqlite, gd
2525
tools: composer:v2
2626
coverage: none
2727

2828
- name: Install dependencies
29-
uses: nick-invision/retry@v1
29+
uses: nick-invision/retry@v2
3030
with:
3131
timeout_minutes: 5
3232
max_attempts: 2

.github/workflows/tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ jobs:
1111
strategy:
1212
fail-fast: true
1313
matrix:
14-
php: ['7.3', '7.4', '8.0']
14+
php: ['7.3', '7.4', '8.0', '8.1']
1515
stability: [prefer-lowest, prefer-stable]
1616

1717
name: PHP ${{ matrix.php }} - ${{ matrix.stability }}
1818

1919
steps:
2020
- name: Checkout code
21-
uses: actions/checkout@v2
21+
uses: actions/checkout@v3
2222

2323
- name: Setup PHP
2424
uses: shivammathur/setup-php@v2
@@ -29,7 +29,7 @@ jobs:
2929
coverage: none
3030

3131
- name: Install dependencies
32-
uses: nick-invision/retry@v1
32+
uses: nick-invision/retry@v2
3333
with:
3434
timeout_minutes: 5
3535
max_attempts: 2

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Laravel Relation Joins
22

3-
[![Laravel Version](https://img.shields.io/badge/Laravel-7.x%2F8.x%2F9.x-blue)](https://laravel.com/)
3+
[![Laravel Version](https://img.shields.io/badge/Laravel-8.x%2F9.x%2F10.x-blue)](https://laravel.com/)
44
[![Build Status](https://github.com/tylernathanreed/laravel-relation-joins/workflows/tests/badge.svg)](https://github.com/tylernathanreed/laravel-relation-joins/actions)
55
[![Style Status](https://github.com/tylernathanreed/laravel-relation-joins/workflows/style/badge.svg)](https://github.com/tylernathanreed/laravel-relation-joins/actions)
66
[![Coverage Status](https://coveralls.io/repos/github/tylernathanreed/laravel-relation-joins/badge.svg?branch=master)](https://coveralls.io/github/tylernathanreed/laravel-relation-joins?branch=master)
@@ -62,8 +62,9 @@ Reedware\LaravelRelationJoins\LaravelRelationJoinServiceProvider::class
6262
<a name="versioning"></a>
6363
### Versioning
6464

65-
This package was built with the latest version of Laravel in mind, but support goes back to Laravel 7.x.
65+
This package was built with the latest version of Laravel in mind, but support goes back to Laravel 8.x.
6666

67+
For Laravel 7.x, use version 3.x of this package.
6768
For Laravel 6.x, use version 2.x of this package.
6869
For Laravel 5.5, use version 1.x of this package.
6970

composer.json

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,16 @@
1010
}
1111
],
1212
"require": {
13-
"php": ">=7.2.5",
14-
"illuminate/database": "^7.30.4|^8.23|^9.0",
15-
"illuminate/support": "^7.30.4|^8.23|^9.0"
13+
"php": ">=7.3",
14+
"illuminate/contracts": "^8.83|^9.52|^10.0",
15+
"illuminate/database": "^8.83|^9.52|^10.0",
16+
"illuminate/support": "^8.83|^9.52|^10.0"
1617
},
1718
"require-dev": {
18-
"illuminate/container": "^7.30.4|^8.23|^9.0",
19-
"mockery/mockery": "^1.4.3",
19+
"illuminate/container": "^8.83|^9.52|^10.0",
20+
"mockery/mockery": "^1.5.1",
2021
"php-coveralls/php-coveralls": "^2.4",
21-
"phpunit/phpunit": "^8.5|^9.5",
22+
"phpunit/phpunit": "^8.5.33|^9.5",
2223
"squizlabs/php_codesniffer": "^3.6"
2324
},
2425
"autoload": {

src/RelationJoinQuery.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ protected static function belongsTo(Relation $relation, Builder $query, Builder
111111
*/
112112
protected static function belongsToMany(Relation $relation, Builder $query, Builder $parentQuery, string $type = 'inner', string $alias = null)
113113
{
114-
if (strpos($alias, ',') !== false) {
114+
if (! is_null($alias) && strpos($alias, ',') !== false) {
115115
[$pivotAlias, $farAlias] = explode(',', $alias);
116116
} else {
117117
[$pivotAlias, $farAlias] = [null, $alias];
@@ -202,7 +202,7 @@ protected static function hasOneOrMany(Relation $relation, Builder $query, Build
202202
*/
203203
protected static function hasOneOrManyThrough(Relation $relation, Builder $query, Builder $parentQuery, string $type = 'inner', string $alias = null)
204204
{
205-
if (strpos($alias, ',') !== false) {
205+
if (! is_null($alias) && strpos($alias, ',') !== false) {
206206
[$throughAlias, $farAlias] = explode(',', $alias);
207207
} else {
208208
[$throughAlias, $farAlias] = [null, $alias];
@@ -279,7 +279,7 @@ protected static function morphOneOrMany(Relation $relation, Builder $query, Bui
279279
*/
280280
protected static function morphToMany(Relation $relation, Builder $query, Builder $parentQuery, string $type = 'inner', string $alias = null)
281281
{
282-
if (strpos($alias, ',') !== false) {
282+
if (! is_null($alias) && strpos($alias, ',') !== false) {
283283
[$pivotAlias, $farAlias] = explode(',', $alias);
284284
} else {
285285
[$pivotAlias, $farAlias] = [null, $alias];

0 commit comments

Comments
 (0)