Skip to content

Commit

Permalink
Merge pull request #1164 from duncanmcclean/laravel-12
Browse files Browse the repository at this point in the history
Supports Laravel 12
  • Loading branch information
mfn authored Feb 24, 2025
2 parents 7d13a57 + f256332 commit 8a9de2d
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 22 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,13 @@ jobs:
fail-fast: false
matrix:
php: [8.1, 8.2, 8.3, 8.4]
laravel: [^10.0, ^11.0]
laravel: [^10.0, ^11.0, ^12.0]
stability: [prefer-lowest, prefer-stable]
exclude:
- php: 8.1
laravel: ^11.0
- php: 8.1
laravel: ^12.0
name: P=${{ matrix.php }} L=${{ matrix.laravel }} ${{ matrix.stability }}
runs-on: ubuntu-latest
env:
Expand All @@ -51,8 +53,6 @@ jobs:
- run: composer remove --dev friendsofphp/php-cs-fixer --no-update
- run: composer remove --dev phpstan/phpstan --no-update
- run: composer require illuminate/contracts:${{ matrix.laravel }} --no-update
- run: composer require illuminate/contracts:9.33 --no-update
if: matrix.laravel == '^9.0' && matrix.stability == 'prefer-lowest'

- name: Get composer cache directory
id: composer-cache
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ CHANGELOG

[Next release](https://github.com/rebing/graphql-laravel/compare/9.7.0...master)

## Added
- Support for Laravel 12 [\#1164 / duncanmcclean](https://github.com/rebing/graphql-laravel/pull/1164)

2024-11-22, 9.7.0
-----------------

Expand Down
14 changes: 7 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
"require": {
"php": "^8.1",
"ext-json": "*",
"illuminate/contracts": "^10.0|^11.0",
"illuminate/support": "^10.0|^11.0",
"illuminate/contracts": "^10.0|^11.0|^12.0",
"illuminate/support": "^10.0|^11.0|^12.0",
"laragraph/utils": "^2.0.1",
"thecodingmachine/safe": "^2.4",
"webonyx/graphql-php": "^15.0.3"
Expand All @@ -46,13 +46,13 @@
"ext-pdo_sqlite": "*",
"fakerphp/faker": "^1.6",
"friendsofphp/php-cs-fixer": "^3",
"larastan/larastan": "^2",
"laravel/framework": "^10.0|^11.0",
"larastan/larastan": "^3",
"laravel/framework": "^10.0|^11.0|^12.0",
"mfn/php-cs-fixer-config": "^2",
"mockery/mockery": "^1.5",
"orchestra/testbench-core": "^8.0|^9.0",
"phpstan/phpstan": "^1",
"phpunit/phpunit": "^10.5.32",
"phpstan/phpstan": "^2",
"orchestra/testbench": "^8.0|^9.0|^10.0",
"phpunit/phpunit": "^10.5.32 || ^11.0",
"thecodingmachine/phpstan-safe-rule": "^1"
},
"autoload": {
Expand Down
4 changes: 4 additions & 0 deletions tests/Unit/NoRoutesRegisteredTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ class NoRoutesRegisteredTest extends TestCase
{
protected function getEnvironmentSetUp($app): void
{
// Laravel registers routes for local filesystems by default.
// However, for the purpose of this test, we don't want it to register any routes.
$app['config']->set('filesystems.disks.local.serve', false);

$app['config']->set('graphql', [
'route' => [],
'schemas' => [
Expand Down
4 changes: 4 additions & 0 deletions tests/Unit/RoutesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ class RoutesTest extends TestCase
{
protected function getEnvironmentSetUp($app): void
{
// Laravel registers routes for local filesystems by default.
// However, for the purpose of this test, we don't want it to register any routes.
$app['config']->set('filesystems.disks.local.serve', false);

$app['config']->set('graphql', [
'route' => [
'prefix' => 'graphql_test',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
declare(strict_types = 1);
namespace Rebing\GraphQL\Tests\Unit\ValidationOfFieldArguments;

use Composer\InstalledVersions;
use Rebing\GraphQL\Tests\TestCase;

class ValidationOfFieldArgumentsTest extends TestCase
Expand Down Expand Up @@ -83,12 +82,6 @@ public function testRulesTakesEffect(): void
],
];

if ($this->orchestraTestbenchCoreVersionBelow('6.17.1.0')) {
$expected['errors'][0]['extensions']['validation']['profile.args.profileId'] = [
'The profile.args.profile id may not be greater than 10.',
];
}

self::assertEquals($expected, $result);
}

Expand Down Expand Up @@ -138,9 +131,4 @@ public function testOnlyApplicableRulesTakesEffect(): void
];
self::assertEquals($expected, $result);
}

private function orchestraTestbenchCoreVersionBelow(string $versionString): bool
{
return InstalledVersions::getVersion('orchestra/testbench-core') < $versionString;
}
}

0 comments on commit 8a9de2d

Please sign in to comment.