From 86b78d8c07a6588226906229834537ce4dfa12dc Mon Sep 17 00:00:00 2001 From: AlexVanderbist Date: Mon, 8 Jan 2024 10:09:04 +0000 Subject: [PATCH 01/16] Update CHANGELOG --- CHANGELOG.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 615f0b3f..003e9518 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,28 @@ All notable changes to `laravel-query-builder` will be documented in this file +## 5.7.0 - 2024-01-08 + +### What's Changed + +* Start testing against PHP 8.3 by @sergiy-petrov in https://github.com/spatie/laravel-query-builder/pull/899 +* Add the possibility to use the literal relation names in the `allowedFields`. by @carvemerson in https://github.com/spatie/laravel-query-builder/pull/917 +* Add `unsetDefault` as a replacement for `default(null)` which was removed in 5.6.0 by @patrickrobrecht in https://github.com/spatie/laravel-query-builder/pull/902 +* Allow passing an array to the `defaultSort` function as documented by @MajidMohammadian in https://github.com/spatie/laravel-query-builder/pull/904 +* Add `disable_invalid_includes_query_exception` config option by @dimzeta in https://github.com/spatie/laravel-query-builder/pull/906 +* Update `AllowedFilter.php` to include `getFilterClass` function by @justasSendrauskas in https://github.com/spatie/laravel-query-builder/pull/909 + +### New Contributors + +* @sergiy-petrov made their first contribution in https://github.com/spatie/laravel-query-builder/pull/899 +* @carvemerson made their first contribution in https://github.com/spatie/laravel-query-builder/pull/917 +* @patrickrobrecht made their first contribution in https://github.com/spatie/laravel-query-builder/pull/902 +* @MajidMohammadian made their first contribution in https://github.com/spatie/laravel-query-builder/pull/904 +* @dimzeta made their first contribution in https://github.com/spatie/laravel-query-builder/pull/906 +* @justasSendrauskas made their first contribution in https://github.com/spatie/laravel-query-builder/pull/909 + +**Full Changelog**: https://github.com/spatie/laravel-query-builder/compare/5.6.0...5.7.0 + ## 5.6.0 - 2023-10-05 ### What's Changed From 4ab28105c467dc476e4b2779ebd8df97d3226282 Mon Sep 17 00:00:00 2001 From: Hamid Dehnavi Date: Sun, 14 Jan 2024 10:51:01 +0330 Subject: [PATCH 02/16] Update config file content --- docs/installation-setup.md | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/docs/installation-setup.md b/docs/installation-setup.md index a5a41a82..557002b2 100644 --- a/docs/installation-setup.md +++ b/docs/installation-setup.md @@ -50,11 +50,34 @@ return [ * For example: GET /users?include=postsExists */ 'exists_suffix' => 'Exists', - + /* * By default the package will throw an `InvalidFilterQuery` exception when a filter in the * URL is not allowed in the `allowedFilters()` method. */ 'disable_invalid_filter_query_exception' => false, + + /* + * By default the package will throw an `InvalidSortQuery` exception when a sort in the + * URL is not allowed in the `allowedSorts()` method. + */ + 'disable_invalid_sort_query_exception' => false, + + /* + * By default the package will throw an `InvalidIncludeQuery` exception when an include in the + * URL is not allowed in the `allowedIncludes()` method. + */ + 'disable_invalid_includes_query_exception' => false, + + /* + * By default, the package expects relationship names to be snake case plural when using fields[relationship]. + * For example, fetching the id and name for a userOwner relation would look like this: + * GET /users?fields[user_owner]=id,name + * + * Set this to `false` if you don't want that and keep the requested relationship names as-is and allows you to + * request the fields using a camelCase relationship name: + * GET /users?fields[userOwner]=id,name + */ + 'convert_relation_names_to_snake_case_plural' => true, ]; ``` From 245af12a873122acf75fec54544d6e6061a87e12 Mon Sep 17 00:00:00 2001 From: Steve McDougall Date: Tue, 6 Feb 2024 13:25:00 +0000 Subject: [PATCH 03/16] Update composer.json --- composer.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 0f52def7..9a2f6fa5 100644 --- a/composer.json +++ b/composer.json @@ -21,9 +21,9 @@ ], "require": { "php": "^8.0", - "illuminate/database": "^9.0|^10.0", - "illuminate/http": "^9.0|^10.0", - "illuminate/support": "^9.0|^10.0", + "illuminate/database": "^10.0|^11.0", + "illuminate/http": "^10.0|^11.0", + "illuminate/support": "^10.0|^11.0", "spatie/laravel-package-tools": "^1.11" }, "require-dev": { From 36df4c50f7d9d6b28f4d0a2282c720c132277747 Mon Sep 17 00:00:00 2001 From: Steve McDougall Date: Tue, 6 Feb 2024 13:26:41 +0000 Subject: [PATCH 04/16] Update run-tests.yml --- .github/workflows/run-tests.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index e56b1478..691b248a 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -9,15 +9,15 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - php: [8.3, 8.2, 8.1, 8.0] + php: [8.3, 8.2, 8.1] laravel: [9.*, 10.*] stability: [prefer-lowest, prefer-stable] include: - - laravel: 10.* + - laravel: 11.* testbench: 8.* carbon: ^2.63 - - laravel: 9.* - testbench: 7.* + - laravel: 10.* + testbench: 8.* carbon: ^2.63 exclude: - laravel: 10.* From 74d9f7dd5bebba3b4c28159e03fcf3f00be93f7c Mon Sep 17 00:00:00 2001 From: Steve McDougall Date: Tue, 6 Feb 2024 13:29:38 +0000 Subject: [PATCH 05/16] Update composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 9a2f6fa5..1836288c 100644 --- a/composer.json +++ b/composer.json @@ -20,7 +20,7 @@ } ], "require": { - "php": "^8.0", + "php": "^8.1", "illuminate/database": "^10.0|^11.0", "illuminate/http": "^10.0|^11.0", "illuminate/support": "^10.0|^11.0", From fd274a24a62672ed4369f58108146c1d57ffc994 Mon Sep 17 00:00:00 2001 From: Freek Van der Herten Date: Tue, 6 Feb 2024 20:53:30 +0100 Subject: [PATCH 06/16] Update run-tests.yml From bda99e2e7a0defd6f0f2d5e3e9bb4604b0702ae7 Mon Sep 17 00:00:00 2001 From: Freek Van der Herten Date: Tue, 6 Feb 2024 20:56:16 +0100 Subject: [PATCH 07/16] wip --- .github/workflows/run-tests.yml | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 691b248a..ed004a53 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -1,16 +1,24 @@ name: run-tests -on: [push, pull_request] +on: + push: + paths: + - '**.php' + - '.github/workflows/run-tests.yml' + - 'phpunit.xml.dist' + - 'composer.json' + - 'composer.lock' jobs: test: runs-on: ${{ matrix.os }} + timeout-minutes: 5 strategy: - fail-fast: false + fail-fast: true matrix: os: [ubuntu-latest] php: [8.3, 8.2, 8.1] - laravel: [9.*, 10.*] + laravel: [9.*, 10.*, 11.*] stability: [prefer-lowest, prefer-stable] include: - laravel: 11.* @@ -18,10 +26,6 @@ jobs: carbon: ^2.63 - laravel: 10.* testbench: 8.* - carbon: ^2.63 - exclude: - - laravel: 10.* - php: 8.0 name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} From d8a4e0bfb061f69693307a9d5ec1973a8a24923a Mon Sep 17 00:00:00 2001 From: Freek Van der Herten Date: Tue, 6 Feb 2024 20:59:02 +0100 Subject: [PATCH 08/16] wip --- .github/workflows/run-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index ed004a53..ad02a005 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -18,7 +18,7 @@ jobs: matrix: os: [ubuntu-latest] php: [8.3, 8.2, 8.1] - laravel: [9.*, 10.*, 11.*] + laravel: [10.*, 11.*] stability: [prefer-lowest, prefer-stable] include: - laravel: 11.* From 9f2ff1617a940a6da5a9d76b78c80920de1252b8 Mon Sep 17 00:00:00 2001 From: Freek Van der Herten Date: Tue, 6 Feb 2024 21:00:25 +0100 Subject: [PATCH 09/16] wip --- .github/workflows/run-tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index ad02a005..231f2f5e 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -19,7 +19,7 @@ jobs: os: [ubuntu-latest] php: [8.3, 8.2, 8.1] laravel: [10.*, 11.*] - stability: [prefer-lowest, prefer-stable] + stability: [prefer-stable] include: - laravel: 11.* testbench: 8.* @@ -71,7 +71,7 @@ jobs: - name: Install dependencies run: | - composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" "nesbot/carbon:${{ matrix.carbon }}" --no-interaction --no-update + composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update composer update --${{ matrix.stability }} --prefer-dist --no-interaction - name: Execute tests From 9615170ad96fa096b094594266bfedb9c6edddcc Mon Sep 17 00:00:00 2001 From: Freek Van der Herten Date: Tue, 6 Feb 2024 21:02:10 +0100 Subject: [PATCH 10/16] wip --- .github/workflows/run-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 231f2f5e..e379bba5 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -22,7 +22,7 @@ jobs: stability: [prefer-stable] include: - laravel: 11.* - testbench: 8.* + testbench: 9.* carbon: ^2.63 - laravel: 10.* testbench: 8.* From a88f64a4e284a063a205cd4e147d581f2f547b8f Mon Sep 17 00:00:00 2001 From: Freek Van der Herten Date: Tue, 6 Feb 2024 21:04:38 +0100 Subject: [PATCH 11/16] wip --- composer.json | 3 +-- phpunit.xml.dist | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 1836288c..215c9a62 100644 --- a/composer.json +++ b/composer.json @@ -30,8 +30,7 @@ "ext-json": "*", "mockery/mockery": "^1.4", "orchestra/testbench": "^7.0|^8.0", - "pestphp/pest": "^1.20", - "phpunit/phpunit": "^9.6.11", + "pestphp/pest": "^2.0", "spatie/invade": "^2.0", "spatie/laravel-ray": "^1.28" }, diff --git a/phpunit.xml.dist b/phpunit.xml.dist index e2b394ec..c1dcc8bb 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,5 +1,5 @@ - + tests From 8d8b527a68d4651b7860d9993a33b8d4774a9d72 Mon Sep 17 00:00:00 2001 From: Freek Van der Herten Date: Tue, 6 Feb 2024 21:07:16 +0100 Subject: [PATCH 12/16] wip --- .github/workflows/run-tests.yml | 2 +- composer.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index e379bba5..088ac821 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -17,7 +17,7 @@ jobs: fail-fast: true matrix: os: [ubuntu-latest] - php: [8.3, 8.2, 8.1] + php: [8.3, 8.2] laravel: [10.*, 11.*] stability: [prefer-stable] include: diff --git a/composer.json b/composer.json index 215c9a62..b8fc724a 100644 --- a/composer.json +++ b/composer.json @@ -20,7 +20,7 @@ } ], "require": { - "php": "^8.1", + "php": "^8.2", "illuminate/database": "^10.0|^11.0", "illuminate/http": "^10.0|^11.0", "illuminate/support": "^10.0|^11.0", From 669fcfdae6648984d860d441fe9db8ee3390fda7 Mon Sep 17 00:00:00 2001 From: freekmurze Date: Tue, 6 Feb 2024 20:09:54 +0000 Subject: [PATCH 13/16] Update CHANGELOG --- CHANGELOG.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 003e9518..4ebfe784 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,20 @@ All notable changes to `laravel-query-builder` will be documented in this file +## 5.8.0 - 2024-02-06 + +### What's Changed + +* [Docs] Update config file content by @shdehnavi in https://github.com/spatie/laravel-query-builder/pull/918 +* Bump: Deprecating Laravel 9 and PHP 8.1, adding Laravel 11 support by @JustSteveKing in https://github.com/spatie/laravel-query-builder/pull/922 + +### New Contributors + +* @shdehnavi made their first contribution in https://github.com/spatie/laravel-query-builder/pull/918 +* @JustSteveKing made their first contribution in https://github.com/spatie/laravel-query-builder/pull/922 + +**Full Changelog**: https://github.com/spatie/laravel-query-builder/compare/5.7.0...5.8.0 + ## 5.7.0 - 2024-01-08 ### What's Changed From 8e0b676d9e13aebf8e127d4eac9622cd96daaca9 Mon Sep 17 00:00:00 2001 From: Kekeocha Justin Chetachukwu Date: Fri, 23 Feb 2024 13:39:05 +0100 Subject: [PATCH 14/16] fix typo --- docs/features/sorting.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/features/sorting.md b/docs/features/sorting.md index 825dfcc2..c4497860 100644 --- a/docs/features/sorting.md +++ b/docs/features/sorting.md @@ -5,7 +5,7 @@ weight: 2 The `sort` query parameter is used to determine by which property the results collection will be ordered. Sorting is ascending by default and can be reversed by adding a hyphen (`-`) to the start of the property name. -All sorts have to be explicitly allowed by passing an array to the `allowedSorts()` method. The `allowedSorts` method takes an array of column names as strings or instances of `AllowedSorts`s. +All sorts have to be explicitly allowed by passing an array to the `allowedSorts()` method. The `allowedSorts` method takes an array of column names as strings or instances of `AllowedSorts`. For more advanced use cases, [custom sorts](#content-custom-sorts) can be used. From 0319269af7688b20766fb4021b9973832ca13f41 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Mar 2024 17:25:23 +0000 Subject: [PATCH 15/16] Bump dependabot/fetch-metadata from 1.6.0 to 2.0.0 Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 1.6.0 to 2.0.0. - [Release notes](https://github.com/dependabot/fetch-metadata/releases) - [Commits](https://github.com/dependabot/fetch-metadata/compare/v1.6.0...v2.0.0) --- updated-dependencies: - dependency-name: dependabot/fetch-metadata dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/dependabot-auto-merge.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dependabot-auto-merge.yml b/.github/workflows/dependabot-auto-merge.yml index 60183c52..ecf41953 100644 --- a/.github/workflows/dependabot-auto-merge.yml +++ b/.github/workflows/dependabot-auto-merge.yml @@ -13,7 +13,7 @@ jobs: - name: Dependabot metadata id: metadata - uses: dependabot/fetch-metadata@v1.6.0 + uses: dependabot/fetch-metadata@v2.0.0 with: github-token: "${{ secrets.GITHUB_TOKEN }}" compat-lookup: true From 88c499dd3a2bdff42e153bacc447830f60d2ef76 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Apr 2024 17:23:48 +0000 Subject: [PATCH 16/16] Bump dependabot/fetch-metadata from 2.0.0 to 2.1.0 Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 2.0.0 to 2.1.0. - [Release notes](https://github.com/dependabot/fetch-metadata/releases) - [Commits](https://github.com/dependabot/fetch-metadata/compare/v2.0.0...v2.1.0) --- updated-dependencies: - dependency-name: dependabot/fetch-metadata dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/dependabot-auto-merge.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dependabot-auto-merge.yml b/.github/workflows/dependabot-auto-merge.yml index ecf41953..c09678fd 100644 --- a/.github/workflows/dependabot-auto-merge.yml +++ b/.github/workflows/dependabot-auto-merge.yml @@ -13,7 +13,7 @@ jobs: - name: Dependabot metadata id: metadata - uses: dependabot/fetch-metadata@v2.0.0 + uses: dependabot/fetch-metadata@v2.1.0 with: github-token: "${{ secrets.GITHUB_TOKEN }}" compat-lookup: true