Skip to content

Commit

Permalink
Merge pull request #24 from tylernathanreed/10.x
Browse files Browse the repository at this point in the history
Laravel 10.x Support
  • Loading branch information
tylernathanreed authored Apr 1, 2023
2 parents 9436207 + cb390df commit 3b001f6
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 20 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.0
php-version: 8.1
extensions: dom, curl, libxml, mbstring, zip, pdo, sqlite, pdo_sqlite, gd, xdebug
tools: composer:v2
coverage: xdebug

- name: Install dependencies
uses: nick-invision/retry@v1
uses: nick-invision/retry@v2
with:
timeout_minutes: 5
max_attempts: 2
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.0
php-version: 8.1
extensions: dom, curl, libxml, mbstring, zip, pdo, sqlite, pdo_sqlite, gd
tools: composer:v2
coverage: none

- name: Install dependencies
uses: nick-invision/retry@v1
uses: nick-invision/retry@v2
with:
timeout_minutes: 5
max_attempts: 2
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ jobs:
strategy:
fail-fast: true
matrix:
php: ['7.3', '7.4', '8.0']
php: ['7.3', '7.4', '8.0', '8.1']
stability: [prefer-lowest, prefer-stable]

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

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand All @@ -29,7 +29,7 @@ jobs:
coverage: none

- name: Install dependencies
uses: nick-invision/retry@v1
uses: nick-invision/retry@v2
with:
timeout_minutes: 5
max_attempts: 2
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Laravel Relation Joins

[![Laravel Version](https://img.shields.io/badge/Laravel-7.x%2F8.x%2F9.x-blue)](https://laravel.com/)
[![Laravel Version](https://img.shields.io/badge/Laravel-8.x%2F9.x%2F10.x-blue)](https://laravel.com/)
[![Build Status](https://github.com/tylernathanreed/laravel-relation-joins/workflows/tests/badge.svg)](https://github.com/tylernathanreed/laravel-relation-joins/actions)
[![Style Status](https://github.com/tylernathanreed/laravel-relation-joins/workflows/style/badge.svg)](https://github.com/tylernathanreed/laravel-relation-joins/actions)
[![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)
Expand Down Expand Up @@ -62,8 +62,9 @@ Reedware\LaravelRelationJoins\LaravelRelationJoinServiceProvider::class
<a name="versioning"></a>
### Versioning

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

For Laravel 7.x, use version 3.x of this package.
For Laravel 6.x, use version 2.x of this package.
For Laravel 5.5, use version 1.x of this package.

Expand Down
13 changes: 7 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,16 @@
}
],
"require": {
"php": ">=7.2.5",
"illuminate/database": "^7.30.4|^8.23|^9.0",
"illuminate/support": "^7.30.4|^8.23|^9.0"
"php": ">=7.3",
"illuminate/contracts": "^8.83|^9.52|^10.0",
"illuminate/database": "^8.83|^9.52|^10.0",
"illuminate/support": "^8.83|^9.52|^10.0"
},
"require-dev": {
"illuminate/container": "^7.30.4|^8.23|^9.0",
"mockery/mockery": "^1.4.3",
"illuminate/container": "^8.83|^9.52|^10.0",
"mockery/mockery": "^1.5.1",
"php-coveralls/php-coveralls": "^2.4",
"phpunit/phpunit": "^8.5|^9.5",
"phpunit/phpunit": "^8.5.33|^9.5",
"squizlabs/php_codesniffer": "^3.6"
},
"autoload": {
Expand Down
6 changes: 3 additions & 3 deletions src/RelationJoinQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ protected static function belongsTo(Relation $relation, Builder $query, Builder
*/
protected static function belongsToMany(Relation $relation, Builder $query, Builder $parentQuery, string $type = 'inner', string $alias = null)
{
if (strpos($alias, ',') !== false) {
if (! is_null($alias) && strpos($alias, ',') !== false) {
[$pivotAlias, $farAlias] = explode(',', $alias);
} else {
[$pivotAlias, $farAlias] = [null, $alias];
Expand Down Expand Up @@ -202,7 +202,7 @@ protected static function hasOneOrMany(Relation $relation, Builder $query, Build
*/
protected static function hasOneOrManyThrough(Relation $relation, Builder $query, Builder $parentQuery, string $type = 'inner', string $alias = null)
{
if (strpos($alias, ',') !== false) {
if (! is_null($alias) && strpos($alias, ',') !== false) {
[$throughAlias, $farAlias] = explode(',', $alias);
} else {
[$throughAlias, $farAlias] = [null, $alias];
Expand Down Expand Up @@ -279,7 +279,7 @@ protected static function morphOneOrMany(Relation $relation, Builder $query, Bui
*/
protected static function morphToMany(Relation $relation, Builder $query, Builder $parentQuery, string $type = 'inner', string $alias = null)
{
if (strpos($alias, ',') !== false) {
if (! is_null($alias) && strpos($alias, ',') !== false) {
[$pivotAlias, $farAlias] = explode(',', $alias);
} else {
[$pivotAlias, $farAlias] = [null, $alias];
Expand Down

0 comments on commit 3b001f6

Please sign in to comment.