Skip to content

Commit

Permalink
Merge branch 'main' into phpstan
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexVanderbist authored May 10, 2024
2 parents 64162fc + 287ce2e commit fef22d9
Show file tree
Hide file tree
Showing 7 changed files with 84 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/dependabot-auto-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:

- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v1.6.0
uses: dependabot/fetch-metadata@v2.1.0
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
compat-lookup: true
Expand Down
27 changes: 16 additions & 11 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,32 @@
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: true
matrix:
os: [ubuntu-latest]
php: [8.3, 8.2, 8.1, 8.0]
laravel: [9.*, 10.*]
stability: [prefer-lowest, prefer-stable]
php: [8.3, 8.2]
laravel: [10.*, 11.*]
stability: [prefer-stable]
include:
- laravel: 10.*
testbench: 8.*
- laravel: 11.*
testbench: 9.*
carbon: ^2.63
- laravel: 9.*
testbench: 7.*
carbon: ^2.63
exclude:
- laravel: 10.*
php: 8.0
testbench: 8.*

name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}

Expand Down Expand Up @@ -65,7 +70,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
Expand Down
36 changes: 36 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,42 @@

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

* 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
Expand Down
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,20 @@
}
],
"require": {
"php": "^8.0",
"illuminate/database": "^9.0|^10.0",
"illuminate/http": "^9.0|^10.0",
"illuminate/support": "^9.0|^10.0",
"php": "^8.2",
"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": {
"ext-json": "*",
"mockery/mockery": "^1.4",
"nunomaduro/larastan": "^2.0",
"orchestra/testbench": "^7.0|^8.0",
"pestphp/pest": "^1.20",
"phpunit/phpunit": "^9.6.11",
"rector/rector": "^0.18.10",
"pestphp/pest": "^2.0",
"spatie/invade": "^2.0",
"spatie/laravel-ray": "^1.28"
},
Expand Down
2 changes: 1 addition & 1 deletion docs/features/sorting.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
25 changes: 24 additions & 1 deletion docs/installation-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -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,
];
```
2 changes: 1 addition & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/autoload.php" backupGlobals="false" backupStaticAttributes="false" colors="true" verbose="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/autoload.php" backupGlobals="false" colors="true" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" cacheDirectory=".phpunit.cache" backupStaticProperties="false">
<testsuites>
<testsuite name="Spatie Test Suite">
<directory>tests</directory>
Expand Down

0 comments on commit fef22d9

Please sign in to comment.