From 72358981bfc5987616d3edb97b316c69df8c6d6d Mon Sep 17 00:00:00 2001 From: Tyler Date: Sat, 1 Apr 2023 07:40:44 -0500 Subject: [PATCH 01/13] ~ Bump readme for Laravel 10 --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3823c9c..11b07bf 100644 --- a/README.md +++ b/README.md @@ -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) @@ -64,6 +64,7 @@ Reedware\LaravelRelationJoins\LaravelRelationJoinServiceProvider::class This package was built with the latest version of Laravel in mind, but support goes back to Laravel 7.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. From 19f00378e78a48f43ab5cd8957d676ce232a6a83 Mon Sep 17 00:00:00 2001 From: Tyler Date: Sat, 1 Apr 2023 07:43:58 -0500 Subject: [PATCH 02/13] ~ Bump composer dependencies --- composer.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index cfa58ed..d9b709f 100644 --- a/composer.json +++ b/composer.json @@ -10,12 +10,12 @@ } ], "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/database": "^8.23|^9.0|^10.0", + "illuminate/support": "^8.23|^9.0|^10.0" }, "require-dev": { - "illuminate/container": "^7.30.4|^8.23|^9.0", + "illuminate/container": "^8.23|^9.0|^10.0", "mockery/mockery": "^1.4.3", "php-coveralls/php-coveralls": "^2.4", "phpunit/phpunit": "^8.5|^9.5", From 1cb226fa721c4b03a8217a1323afc50e7c6a2fea Mon Sep 17 00:00:00 2001 From: Tyler Date: Sat, 1 Apr 2023 07:45:23 -0500 Subject: [PATCH 03/13] ~ Add PHP 8.1 --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8f2ba09..06f92db 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -11,7 +11,7 @@ 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 }} From 70ceecb046616a9dd1656ceddebf5ec62c0795ff Mon Sep 17 00:00:00 2001 From: Tyler Date: Sat, 1 Apr 2023 07:46:48 -0500 Subject: [PATCH 04/13] ~ Bump PHP version --- .github/workflows/coverage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 043e2e2..660ef8a 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -20,7 +20,7 @@ jobs: - 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 From 6a2d7c68261e7d559d2f3d91127d8b80e32e107b Mon Sep 17 00:00:00 2001 From: Tyler Date: Sat, 1 Apr 2023 07:47:22 -0500 Subject: [PATCH 05/13] ~ Bump PHP version --- .github/workflows/style.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml index 921f381..a84f344 100644 --- a/.github/workflows/style.yml +++ b/.github/workflows/style.yml @@ -20,7 +20,7 @@ jobs: - 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 From 5c1e41279bee3afb2b0baa4b4e76a2c0e9bf0e7b Mon Sep 17 00:00:00 2001 From: Tyler Date: Sat, 1 Apr 2023 07:57:29 -0500 Subject: [PATCH 06/13] ~ Bump runners for Node 16 --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 06f92db..06764e6 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -18,7 +18,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Setup PHP uses: shivammathur/setup-php@v2 @@ -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 From 564cfe5bcc6158b10ea13ace8477a02434981055 Mon Sep 17 00:00:00 2001 From: Tyler Date: Sat, 1 Apr 2023 07:57:49 -0500 Subject: [PATCH 07/13] ~ Bump runners for Node 16 --- .github/workflows/style.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml index a84f344..d81f31d 100644 --- a/.github/workflows/style.yml +++ b/.github/workflows/style.yml @@ -15,7 +15,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Setup PHP uses: shivammathur/setup-php@v2 @@ -26,7 +26,7 @@ jobs: coverage: none - name: Install dependencies - uses: nick-invision/retry@v1 + uses: nick-invision/retry@v2 with: timeout_minutes: 5 max_attempts: 2 From 00acf0aea9aa87a417c1b2cea42592262785d36e Mon Sep 17 00:00:00 2001 From: Tyler Date: Sat, 1 Apr 2023 07:58:14 -0500 Subject: [PATCH 08/13] ~ Bump runners for Node 16 --- .github/workflows/coverage.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 660ef8a..614da17 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -15,7 +15,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Setup PHP uses: shivammathur/setup-php@v2 @@ -26,7 +26,7 @@ jobs: coverage: xdebug - name: Install dependencies - uses: nick-invision/retry@v1 + uses: nick-invision/retry@v2 with: timeout_minutes: 5 max_attempts: 2 From f5e993fbe3a0ea91e4a71b2f0c8c9188d19b644e Mon Sep 17 00:00:00 2001 From: Tyler Date: Sat, 1 Apr 2023 08:01:11 -0500 Subject: [PATCH 09/13] ~ Bump min PHP Unit --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index d9b709f..060c590 100644 --- a/composer.json +++ b/composer.json @@ -18,7 +18,7 @@ "illuminate/container": "^8.23|^9.0|^10.0", "mockery/mockery": "^1.4.3", "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": { From 5fbfeed0ad434744c207c53f87ba88f6bb40b715 Mon Sep 17 00:00:00 2001 From: Tyler Date: Sat, 1 Apr 2023 08:05:34 -0500 Subject: [PATCH 10/13] ~ Bump more minimums --- composer.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 060c590..72ee3b7 100644 --- a/composer.json +++ b/composer.json @@ -11,12 +11,12 @@ ], "require": { "php": ">=7.3", - "illuminate/database": "^8.23|^9.0|^10.0", - "illuminate/support": "^8.23|^9.0|^10.0" + "illuminate/database": "^8.83|^9.52|^10.0", + "illuminate/support": "^8.83|^9.52|^10.0" }, "require-dev": { - "illuminate/container": "^8.23|^9.0|^10.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.33|^9.5", "squizlabs/php_codesniffer": "^3.6" From 12c63b2424b6d6e8a5e8519710a3961f8cce5436 Mon Sep 17 00:00:00 2001 From: Tyler Date: Sat, 1 Apr 2023 08:07:30 -0500 Subject: [PATCH 11/13] ~ Fix warning --- src/RelationJoinQuery.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/RelationJoinQuery.php b/src/RelationJoinQuery.php index c6abe01..ad4a087 100644 --- a/src/RelationJoinQuery.php +++ b/src/RelationJoinQuery.php @@ -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]; @@ -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]; @@ -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]; From f5053ea0e2862327eb09ce215596320a5d112334 Mon Sep 17 00:00:00 2001 From: Tyler Date: Sat, 1 Apr 2023 09:08:04 -0500 Subject: [PATCH 12/13] ~ Update notice --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 11b07bf..504fd99 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,7 @@ Reedware\LaravelRelationJoins\LaravelRelationJoinServiceProvider::class ### 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. From cb390df18d195179778ef80985631158d707f67b Mon Sep 17 00:00:00 2001 From: Tyler Date: Sat, 1 Apr 2023 11:55:47 -0500 Subject: [PATCH 13/13] ~ Bump contracts minimum version --- composer.json | 1 + 1 file changed, 1 insertion(+) diff --git a/composer.json b/composer.json index 72ee3b7..b90f390 100644 --- a/composer.json +++ b/composer.json @@ -11,6 +11,7 @@ ], "require": { "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" },