From 79ddd0393464ced728e012a6b5f454ce183187d5 Mon Sep 17 00:00:00 2001 From: Christopher Gammie Date: Fri, 9 Feb 2024 18:50:41 +0000 Subject: [PATCH 01/28] build: update github actions for php 8.3 --- .github/workflows/tests.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index cdc7504..3d8abe3 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -14,12 +14,12 @@ jobs: strategy: fail-fast: true matrix: - php: [8.1, 8.2] + php: [8.1, 8.2, 8.3] laravel: [10] steps: - name: Checkout Code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup PHP uses: shivammathur/setup-php@v2 @@ -34,7 +34,7 @@ jobs: run: composer require "laravel/framework:^${{ matrix.laravel }}" --no-update - name: Install dependencies - uses: nick-fields/retry@v2 + uses: nick-fields/retry@v3 with: timeout_minutes: 5 max_attempts: 5 From 33376780f8152be1961d1fb4a26dc7db576f1f43 Mon Sep 17 00:00:00 2001 From: Christopher Gammie Date: Sat, 10 Feb 2024 12:00:26 +0000 Subject: [PATCH 02/28] feat: allow middleware registration per action on resource and relations Closes #265 --- CHANGELOG.md | 5 + .../PendingRelationshipRegistration.php | 25 ++++- src/Routing/PendingResourceRegistration.php | 19 +++- src/Routing/RelationshipRegistrar.php | 22 ++++- src/Routing/ResourceRegistrar.php | 24 ++++- tests/lib/Integration/Routing/HasManyTest.php | 86 ++++++++++++++++- tests/lib/Integration/Routing/HasOneTest.php | 88 ++++++++++++++++- .../lib/Integration/Routing/ResourceTest.php | 96 ++++++++++++++++++- 8 files changed, 344 insertions(+), 21 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 38dfa04..6f7e4aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file. This projec ## Unreleased +### Added + +- [#265](https://github.com/laravel-json-api/laravel/issues/265) Allow registration of middleware per action on both + resource routes and relationship routes. + ## [3.2.0] - 2023-11-08 ### Added diff --git a/src/Routing/PendingRelationshipRegistration.php b/src/Routing/PendingRelationshipRegistration.php index d0a5934..b10c97d 100644 --- a/src/Routing/PendingRelationshipRegistration.php +++ b/src/Routing/PendingRelationshipRegistration.php @@ -20,6 +20,7 @@ namespace LaravelJsonApi\Laravel\Routing; use Illuminate\Routing\RouteCollection; +use Illuminate\Support\Arr; class PendingRelationshipRegistration { @@ -155,12 +156,30 @@ public function name(string $method, string $name): self /** * Add middleware to the resource routes. * - * @param string ...$middleware + * @param mixed ...$middleware * @return $this */ - public function middleware(string ...$middleware): self + public function middleware(...$middleware): self { - $this->options['middleware'] = $middleware; + if (count($middleware) === 1) { + $middleware = Arr::wrap($middleware[0]); + } + + if (array_is_list($middleware)) { + $this->options['middleware'] = $middleware; + return $this; + } + + $this->options['middleware'] = Arr::wrap($middleware['*'] ?? null); + + foreach ($this->map as $alias => $action) { + if (isset($middleware[$alias])) { + $middleware[$action] = $middleware[$alias]; + unset($middleware[$alias]); + } + } + + $this->options['action_middleware'] = $middleware; return $this; } diff --git a/src/Routing/PendingResourceRegistration.php b/src/Routing/PendingResourceRegistration.php index d07c8f3..9969690 100644 --- a/src/Routing/PendingResourceRegistration.php +++ b/src/Routing/PendingResourceRegistration.php @@ -21,6 +21,7 @@ use Closure; use Illuminate\Routing\RouteCollection; +use Illuminate\Support\Arr; use InvalidArgumentException; use function is_string; @@ -180,12 +181,22 @@ public function parameter(string $parameter): self /** * Add middleware to the resource routes. * - * @param string ...$middleware + * @param mixed ...$middleware * @return $this */ - public function middleware(string ...$middleware): self + public function middleware(...$middleware): self { - $this->options['middleware'] = $middleware; + if (count($middleware) === 1) { + $middleware = Arr::wrap($middleware[0]); + } + + if (array_is_list($middleware)) { + $this->options['middleware'] = $middleware; + return $this; + } + + $this->options['middleware'] = Arr::wrap($middleware['*'] ?? null); + $this->options['action_middleware'] = $middleware; return $this; } @@ -196,7 +207,7 @@ public function middleware(string ...$middleware): self * @param string ...$middleware * @return $this */ - public function withoutMiddleware(string ...$middleware) + public function withoutMiddleware(string ...$middleware): self { $this->options['excluded_middleware'] = array_merge( (array) ($this->options['excluded_middleware'] ?? []), diff --git a/src/Routing/RelationshipRegistrar.php b/src/Routing/RelationshipRegistrar.php index a9aae8a..2aa2363 100644 --- a/src/Routing/RelationshipRegistrar.php +++ b/src/Routing/RelationshipRegistrar.php @@ -22,6 +22,7 @@ use Illuminate\Contracts\Routing\Registrar as RegistrarContract; use Illuminate\Routing\Route as IlluminateRoute; use Illuminate\Routing\RouteCollection; +use Illuminate\Support\Arr; use LaravelJsonApi\Contracts\Schema\Schema; use LaravelJsonApi\Core\Support\Str; @@ -272,9 +273,10 @@ private function getRelationshipAction( $name = $this->getRelationRouteName($method, $defaultName, $options); $action = ['as' => $name, 'uses' => $this->controller.'@'.$method]; + $middleware = $this->getMiddleware($method, $options); - if (isset($options['middleware'])) { - $action['middleware'] = $options['middleware']; + if (!empty($middleware)) { + $action['middleware'] = $middleware; } if (isset($options['excluded_middleware'])) { @@ -284,6 +286,22 @@ private function getRelationshipAction( return $action; } + /** + * @param string $action + * @param array $options + * @return array + */ + private function getMiddleware(string $action, array $options): array + { + $all = $options['middleware'] ?? []; + $actions = $options['action_middleware'] ?? []; + + return [ + ...$all, + ...Arr::wrap($actions[$action] ?? null), + ]; + } + /** * @param string $fieldName * @return string diff --git a/src/Routing/ResourceRegistrar.php b/src/Routing/ResourceRegistrar.php index bde73d8..495a69a 100644 --- a/src/Routing/ResourceRegistrar.php +++ b/src/Routing/ResourceRegistrar.php @@ -23,6 +23,7 @@ use Illuminate\Contracts\Routing\Registrar as RegistrarContract; use Illuminate\Routing\Route as IlluminateRoute; use Illuminate\Routing\RouteCollection; +use Illuminate\Support\Arr; use LaravelJsonApi\Contracts\Server\Server; use LaravelJsonApi\Core\Support\Str; @@ -337,13 +338,14 @@ private function getResourceAction( string $method, ?string $parameter, array $options - ) { + ): array { $name = $this->getResourceRouteName($resourceType, $method, $options); $action = ['as' => $name, 'uses' => $controller.'@'.$method]; + $middleware = $this->getMiddleware($method, $options); - if (isset($options['middleware'])) { - $action['middleware'] = $options['middleware']; + if (!empty($middleware)) { + $action['middleware'] = $middleware; } if (isset($options['excluded_middleware'])) { @@ -355,6 +357,22 @@ private function getResourceAction( return $action; } + /** + * @param string $action + * @param array $options + * @return array + */ + private function getMiddleware(string $action, array $options): array + { + $all = $options['middleware'] ?? []; + $actions = $options['action_middleware'] ?? []; + + return [ + ...$all, + ...Arr::wrap($actions[$action] ?? null), + ]; + } + /** * Get the action array for the relationships group. * diff --git a/tests/lib/Integration/Routing/HasManyTest.php b/tests/lib/Integration/Routing/HasManyTest.php index 16c3777..f2b28d5 100644 --- a/tests/lib/Integration/Routing/HasManyTest.php +++ b/tests/lib/Integration/Routing/HasManyTest.php @@ -144,13 +144,95 @@ public function testMiddleware(string $method, string $uri): void ->middleware('foo') ->resources(function ($server) { $server->resource('posts')->middleware('bar')->relationships(function ($relations) { - $relations->hasMany('tags')->middleware('baz'); + $relations->hasMany('tags')->middleware('baz1', 'baz2'); }); }); }); $route = $this->assertMatch($method, $uri); - $this->assertSame(['api', 'jsonapi:v1', 'foo', 'bar', 'baz'], $route->action['middleware']); + $this->assertSame(['api', 'jsonapi:v1', 'foo', 'bar', 'baz1', 'baz2'], $route->action['middleware']); + } + + /** + * @param string $method + * @param string $uri + * @dataProvider genericProvider + */ + public function testMiddlewareAsArrayList(string $method, string $uri): void + { + $server = $this->createServer('v1'); + $schema = $this->createSchema($server, 'posts', '\d+'); + $this->createRelation($schema, 'tags'); + + $this->defaultApiRoutesWithNamespace(function () { + JsonApiRoute::server('v1') + ->prefix('v1') + ->namespace('Api\\V1') + ->middleware('foo') + ->resources(function ($server) { + $server->resource('posts')->middleware('bar')->relationships(function ($relations) { + $relations->hasMany('tags')->middleware(['baz1', 'baz2']); + }); + }); + }); + + $route = $this->assertMatch($method, $uri); + $this->assertSame(['api', 'jsonapi:v1', 'foo', 'bar', 'baz1', 'baz2'], $route->action['middleware']); + } + + /** + * @param string $method + * @param string $uri + * @param string $action + * @dataProvider genericProvider + */ + public function testActionMiddleware(string $method, string $uri, string $action): void + { + $actions = [ + '*' => ['baz1', 'baz2'], + 'showRelated' => 'showRelated1', + 'showRelationship' => ['showRelationship1', 'showRelationship2'], + 'updateRelationship' => 'updateRelationship1', + 'attachRelationship' => ['attachRelationship1', 'attachRelationship2'], + 'detachRelationship' => 'detachRelationship1', + ]; + + $expected = [ + 'api', + 'jsonapi:v1', + 'foo', + 'bar', + ...$actions['*'], + ...Arr::wrap($actions[$action]), + ]; + + $server = $this->createServer('v1'); + $schema = $this->createSchema($server, 'posts', '\d+'); + $this->createRelation($schema, 'tags'); + + $this->defaultApiRoutesWithNamespace(function () use ($actions) { + JsonApiRoute::server('v1') + ->prefix('v1') + ->namespace('Api\\V1') + ->middleware('foo') + ->resources(function ($server) use ($actions) { + $server->resource('posts')->middleware('bar')->relationships( + function ($relations) use ($actions) { + $relations->hasMany('tags')->middleware([ + '*' => $actions['*'], + 'related' => $actions['showRelated'], + 'show' => $actions['showRelationship'], + 'update' => $actions['updateRelationship'], + 'attach' => $actions['attachRelationship'], + 'detach' => $actions['detachRelationship'], + ]); + }, + ); + }); + }); + + $route = $this->assertMatch($method, $uri); + $this->assertSame($expected, $route->action['middleware']); } /** diff --git a/tests/lib/Integration/Routing/HasOneTest.php b/tests/lib/Integration/Routing/HasOneTest.php index 8a85cc6..3861988 100644 --- a/tests/lib/Integration/Routing/HasOneTest.php +++ b/tests/lib/Integration/Routing/HasOneTest.php @@ -22,6 +22,8 @@ use Illuminate\Contracts\Routing\Registrar; use LaravelJsonApi\Core\Support\Arr; use LaravelJsonApi\Laravel\Facades\JsonApiRoute; +use LaravelJsonApi\Laravel\Routing\Relationships; +use LaravelJsonApi\Laravel\Routing\ResourceRegistrar; class HasOneTest extends TestCase { @@ -117,11 +119,9 @@ public function testName(string $method, string $uri, string $action): void /** * @param string $method * @param string $uri - * @param string $action - * @param string $name * @dataProvider genericProvider */ - public function testMiddleware(string $method, string $uri, string $action, string $name): void + public function testMiddleware(string $method, string $uri): void { $server = $this->createServer('v1'); $schema = $this->createSchema($server, 'posts', '\d+'); @@ -134,13 +134,91 @@ public function testMiddleware(string $method, string $uri, string $action, stri ->middleware('foo') ->resources(function ($server) { $server->resource('posts')->middleware('bar')->relationships(function ($relations) { - $relations->hasOne('author')->middleware('baz'); + $relations->hasOne('author')->middleware('baz1', 'baz2'); }); }); }); $route = $this->assertMatch($method, $uri); - $this->assertSame(['api', 'jsonapi:v1', 'foo', 'bar', 'baz'], $route->action['middleware']); + $this->assertSame(['api', 'jsonapi:v1', 'foo', 'bar', 'baz1', 'baz2'], $route->action['middleware']); + } + + /** + * @param string $method + * @param string $uri + * @dataProvider genericProvider + */ + public function testMiddlewareAsArrayList(string $method, string $uri): void + { + $server = $this->createServer('v1'); + $schema = $this->createSchema($server, 'posts', '\d+'); + $this->createRelation($schema, 'author'); + + $this->defaultApiRoutesWithNamespace(function () { + JsonApiRoute::server('v1') + ->prefix('v1') + ->namespace('Api\\V1') + ->middleware('foo') + ->resources(function (ResourceRegistrar $server) { + $server->resource('posts')->middleware('bar')->relationships(function (Relationships $relations) { + $relations->hasOne('author')->middleware(['baz1', 'baz2']); + }); + }); + }); + + $route = $this->assertMatch($method, $uri); + $this->assertSame(['api', 'jsonapi:v1', 'foo', 'bar', 'baz1', 'baz2'], $route->action['middleware']); + } + + /** + * @param string $method + * @param string $uri + * @param string $action + * @dataProvider genericProvider + */ + public function testActionMiddleware(string $method, string $uri, string $action): void + { + $actions = [ + '*' => ['baz1', 'baz2'], + 'showRelated' => 'showRelated1', + 'showRelationship' => ['showRelationship1', 'showRelationship2'], + 'updateRelationship' => 'updateRelationship1', + ]; + + $expected = [ + 'api', + 'jsonapi:v1', + 'foo', + 'bar', + ...$actions['*'], + ...Arr::wrap($actions[$action]), + ]; + + $server = $this->createServer('v1'); + $schema = $this->createSchema($server, 'posts', '\d+'); + $this->createRelation($schema, 'author'); + + $this->defaultApiRoutesWithNamespace(function () use ($actions) { + JsonApiRoute::server('v1') + ->prefix('v1') + ->namespace('Api\\V1') + ->middleware('foo') + ->resources(function (ResourceRegistrar $server) use ($actions) { + $server->resource('posts')->middleware('bar')->relationships( + function (Relationships $relations) use ($actions) { + $relations->hasOne('author')->middleware([ + '*' => $actions['*'], + 'related' => $actions['showRelated'], + 'show' => $actions['showRelationship'], + 'update' => $actions['updateRelationship'], + ]); + }, + ); + }); + }); + + $route = $this->assertMatch($method, $uri); + $this->assertSame($expected, $route->action['middleware']); } /** diff --git a/tests/lib/Integration/Routing/ResourceTest.php b/tests/lib/Integration/Routing/ResourceTest.php index 2dad057..c657f42 100644 --- a/tests/lib/Integration/Routing/ResourceTest.php +++ b/tests/lib/Integration/Routing/ResourceTest.php @@ -23,6 +23,7 @@ use Illuminate\Contracts\Routing\Registrar; use LaravelJsonApi\Core\Support\Arr; use LaravelJsonApi\Laravel\Facades\JsonApiRoute; +use LaravelJsonApi\Laravel\Routing\ResourceRegistrar; class ResourceTest extends TestCase { @@ -217,14 +218,14 @@ public function testServerMiddleware(string $method, string $uri): void JsonApiRoute::server('v1') ->prefix('v1') ->namespace('Api\\V1') - ->middleware('foo') + ->middleware('foo', 'bar') ->resources(function ($server) { $server->resource('posts'); }); }); $route = $this->assertMatch($method, $uri); - $this->assertSame(['api', 'jsonapi:v1', 'foo'], $route->action['middleware']); + $this->assertSame(['api', 'jsonapi:v1', 'foo', 'bar'], $route->action['middleware']); } /** @@ -251,6 +252,97 @@ public function testResourceMiddleware(string $method, string $uri): void $this->assertSame(['api', 'jsonapi:v1', 'foo', 'bar'], $route->action['middleware']); } + /** + * @param string $method + * @param string $uri + * @dataProvider routeProvider + */ + public function testResourceWithMultipleMiddleware(string $method, string $uri): void + { + $server = $this->createServer('v1'); + $this->createSchema($server, 'posts', '\d+'); + + $this->defaultApiRoutesWithNamespace(function () { + JsonApiRoute::server('v1') + ->prefix('v1') + ->namespace('Api\\V1') + ->middleware('foo') + ->resources(function ($server) { + $server->resource('posts')->middleware('bar1', 'bar2'); + }); + }); + + $route = $this->assertMatch($method, $uri); + $this->assertSame(['api', 'jsonapi:v1', 'foo', 'bar1', 'bar2'], $route->action['middleware']); + } + + /** + * @param string $method + * @param string $uri + * @dataProvider routeProvider + */ + public function testResourceMiddlewareArrayList(string $method, string $uri): void + { + $server = $this->createServer('v1'); + $this->createSchema($server, 'posts', '\d+'); + + $this->defaultApiRoutesWithNamespace(function () { + JsonApiRoute::server('v1') + ->prefix('v1') + ->namespace('Api\\V1') + ->middleware('foo') + ->resources(function (ResourceRegistrar $server) { + $server->resource('posts')->middleware(['bar1', 'bar2']); + }); + }); + + $route = $this->assertMatch($method, $uri); + $this->assertSame(['api', 'jsonapi:v1', 'foo', 'bar1', 'bar2'], $route->action['middleware']); + } + + + /** + * @param string $method + * @param string $uri + * @param string $action + * @dataProvider routeProvider + */ + public function testResourceActionMiddleware(string $method, string $uri, string $action): void + { + $actions = [ + '*' => ['bar1', 'bar2'], + 'index' => 'index1', + 'store' => ['store1', 'store2'], + 'show' => ['show1'], + 'update' => 'update1', + 'destroy' => 'destroy1', + ]; + + $expected = [ + 'api', + 'jsonapi:v1', + 'foo', + ...$actions['*'], + ...Arr::wrap($actions[$action]), + ]; + + $server = $this->createServer('v1'); + $this->createSchema($server, 'posts', '\d+'); + + $this->defaultApiRoutesWithNamespace(function () use ($actions) { + JsonApiRoute::server('v1') + ->prefix('v1') + ->namespace('Api\\V1') + ->middleware('foo') + ->resources(function (ResourceRegistrar $server) use ($actions) { + $server->resource('posts')->middleware($actions); + }); + }); + + $route = $this->assertMatch($method, $uri); + $this->assertSame($expected, $route->action['middleware']); + } + /** * @param string $method * @param string $uri From 0e10208827acae7281a952efaf870acbd3c668b7 Mon Sep 17 00:00:00 2001 From: Christopher Gammie Date: Wed, 14 Feb 2024 19:09:51 +0000 Subject: [PATCH 03/28] docs: update copyright notices --- src/Console/Concerns/ResolvesStub.php | 2 +- src/Console/GeneratorCommand.php | 2 +- src/Console/MakeAuthorizer.php | 2 +- src/Console/MakeController.php | 2 +- src/Console/MakeFilter.php | 2 +- src/Console/MakeQuery.php | 2 +- src/Console/MakeRequest.php | 2 +- src/Console/MakeRequests.php | 2 +- src/Console/MakeResource.php | 2 +- src/Console/MakeSchema.php | 2 +- src/Console/MakeServer.php | 2 +- src/Console/MakeSortField.php | 2 +- src/Console/StubPublish.php | 2 +- src/Exceptions/HttpNotAcceptableException.php | 2 +- src/Exceptions/HttpUnsupportedMediaTypeException.php | 2 +- src/Facades/JsonApiRoute.php | 2 +- src/Http/Controllers/Actions/AttachRelationship.php | 2 +- src/Http/Controllers/Actions/Destroy.php | 2 +- src/Http/Controllers/Actions/DetachRelationship.php | 2 +- src/Http/Controllers/Actions/FetchMany.php | 2 +- src/Http/Controllers/Actions/FetchOne.php | 2 +- src/Http/Controllers/Actions/FetchRelated.php | 2 +- src/Http/Controllers/Actions/FetchRelationship.php | 2 +- src/Http/Controllers/Actions/Store.php | 2 +- src/Http/Controllers/Actions/Update.php | 2 +- src/Http/Controllers/Actions/UpdateRelationship.php | 2 +- src/Http/Controllers/JsonApiController.php | 2 +- src/Http/Middleware/BootJsonApi.php | 2 +- src/Http/Requests/AnonymousCollectionQuery.php | 2 +- src/Http/Requests/AnonymousQuery.php | 2 +- src/Http/Requests/FormRequest.php | 2 +- src/Http/Requests/RequestResolver.php | 2 +- src/Http/Requests/ResourceQuery.php | 2 +- src/Http/Requests/ResourceRequest.php | 2 +- src/LaravelJsonApi.php | 2 +- src/Routing/ActionProxy.php | 2 +- src/Routing/ActionRegistrar.php | 2 +- src/Routing/PendingRelationshipRegistration.php | 2 +- src/Routing/PendingResourceRegistration.php | 2 +- src/Routing/PendingServerRegistration.php | 2 +- src/Routing/Registrar.php | 2 +- src/Routing/RelationshipRegistrar.php | 2 +- src/Routing/Relationships.php | 2 +- src/Routing/ResourceRegistrar.php | 2 +- src/Routing/Route.php | 2 +- src/ServiceProvider.php | 2 +- tests/dummy/app/Http/Controllers/Api/V1/PostController.php | 2 +- tests/dummy/app/Http/Controllers/Api/V1/UserController.php | 2 +- tests/dummy/app/Http/Controllers/Api/V1/VideoController.php | 2 +- tests/dummy/app/Http/Controllers/Controller.php | 2 +- tests/dummy/app/JsonApi/V1/Comments/CommentSchema.php | 2 +- tests/dummy/app/JsonApi/V1/Images/ImageSchema.php | 2 +- tests/dummy/app/JsonApi/V1/Media/MediaCollectionQuery.php | 2 +- tests/dummy/app/JsonApi/V1/Phones/PhoneSchema.php | 2 +- tests/dummy/app/JsonApi/V1/Posts/PostCollectionQuery.php | 2 +- tests/dummy/app/JsonApi/V1/Posts/PostQuery.php | 2 +- tests/dummy/app/JsonApi/V1/Posts/PostRequest.php | 2 +- tests/dummy/app/JsonApi/V1/Posts/PostSchema.php | 2 +- tests/dummy/app/JsonApi/V1/Posts/PostScope.php | 2 +- tests/dummy/app/JsonApi/V1/Server.php | 2 +- tests/dummy/app/JsonApi/V1/Tags/TagSchema.php | 2 +- tests/dummy/app/JsonApi/V1/Users/UserQuery.php | 2 +- tests/dummy/app/JsonApi/V1/Users/UserRequest.php | 2 +- tests/dummy/app/JsonApi/V1/Users/UserSchema.php | 2 +- tests/dummy/app/JsonApi/V1/Videos/VideoRequest.php | 2 +- tests/dummy/app/JsonApi/V1/Videos/VideoSchema.php | 2 +- tests/dummy/app/Models/Comment.php | 2 +- tests/dummy/app/Models/Image.php | 2 +- tests/dummy/app/Models/Phone.php | 2 +- tests/dummy/app/Models/Post.php | 2 +- tests/dummy/app/Models/Tag.php | 2 +- tests/dummy/app/Models/User.php | 2 +- tests/dummy/app/Models/Video.php | 2 +- tests/dummy/app/Policies/PostPolicy.php | 2 +- tests/dummy/app/Policies/UserPolicy.php | 2 +- tests/dummy/app/Policies/VideoPolicy.php | 2 +- tests/dummy/app/Providers/AppServiceProvider.php | 2 +- tests/dummy/app/Providers/AuthServiceProvider.php | 2 +- tests/dummy/app/Providers/EventServiceProvider.php | 2 +- tests/dummy/app/Providers/RouteServiceProvider.php | 2 +- tests/dummy/config/jsonapi.php | 2 +- tests/dummy/database/factories/CommentFactory.php | 2 +- tests/dummy/database/factories/ImageFactory.php | 2 +- tests/dummy/database/factories/PhoneFactory.php | 2 +- tests/dummy/database/factories/PostFactory.php | 2 +- tests/dummy/database/factories/TagFactory.php | 2 +- tests/dummy/database/factories/UserFactory.php | 2 +- tests/dummy/database/factories/VideoFactory.php | 2 +- .../2020_06_13_143800_create_post_and_video_tables.php | 2 +- .../migrations/2022_06_25_115000_create_phones_table.php | 2 +- tests/dummy/routes/api.php | 2 +- tests/dummy/routes/web.php | 2 +- tests/dummy/tests/Api/V1/Posts/Actions/PublishTest.php | 2 +- tests/dummy/tests/Api/V1/Posts/Actions/PurgeTest.php | 2 +- tests/dummy/tests/Api/V1/Posts/AttachMediaTest.php | 2 +- tests/dummy/tests/Api/V1/Posts/AttachTagsTest.php | 2 +- tests/dummy/tests/Api/V1/Posts/CreateTest.php | 2 +- tests/dummy/tests/Api/V1/Posts/DeleteTest.php | 2 +- tests/dummy/tests/Api/V1/Posts/DetachMediaTest.php | 2 +- tests/dummy/tests/Api/V1/Posts/DetachTagsTest.php | 2 +- tests/dummy/tests/Api/V1/Posts/IndexTest.php | 2 +- tests/dummy/tests/Api/V1/Posts/ReadAuthorIdentifierTest.php | 2 +- tests/dummy/tests/Api/V1/Posts/ReadAuthorTest.php | 2 +- tests/dummy/tests/Api/V1/Posts/ReadCommentIdentifiersTest.php | 2 +- tests/dummy/tests/Api/V1/Posts/ReadCommentsTest.php | 2 +- tests/dummy/tests/Api/V1/Posts/ReadMediaTest.php | 2 +- tests/dummy/tests/Api/V1/Posts/ReadTagIdentifiersTest.php | 2 +- tests/dummy/tests/Api/V1/Posts/ReadTagsTest.php | 2 +- tests/dummy/tests/Api/V1/Posts/ReadTest.php | 2 +- tests/dummy/tests/Api/V1/Posts/UpdateMediaTest.php | 2 +- tests/dummy/tests/Api/V1/Posts/UpdateTagsTest.php | 2 +- tests/dummy/tests/Api/V1/Posts/UpdateTest.php | 2 +- tests/dummy/tests/Api/V1/Serializer.php | 2 +- tests/dummy/tests/Api/V1/TestCase.php | 2 +- tests/dummy/tests/Api/V1/Users/ReadTest.php | 2 +- tests/dummy/tests/Api/V1/Users/UpdatePhoneTest.php | 2 +- tests/dummy/tests/Api/V1/Videos/CreateTest.php | 2 +- tests/dummy/tests/TestCase.php | 2 +- tests/lib/Acceptance/DefaultIncludePaths/Test.php | 2 +- tests/lib/Acceptance/DefaultIncludePaths/TestRequest.php | 2 +- tests/lib/Acceptance/Relationships/ToManyLinksTest.php | 2 +- tests/lib/Acceptance/Relationships/ToOneLinksTest.php | 2 +- tests/lib/Acceptance/RequestBodyContentTest.php | 2 +- tests/lib/Acceptance/ResponseTest.php | 2 +- tests/lib/Acceptance/TestCase.php | 2 +- tests/lib/Integration/Console/MakeAuthorizerTest.php | 2 +- tests/lib/Integration/Console/MakeControllerTest.php | 2 +- tests/lib/Integration/Console/MakeFilterTest.php | 2 +- tests/lib/Integration/Console/MakeQueryTest.php | 2 +- tests/lib/Integration/Console/MakeRequestTest.php | 2 +- tests/lib/Integration/Console/MakeRequestsTest.php | 2 +- tests/lib/Integration/Console/MakeResourceTest.php | 2 +- tests/lib/Integration/Console/MakeSchemaTest.php | 2 +- tests/lib/Integration/Console/MakeServerTest.php | 2 +- tests/lib/Integration/Console/MakeSortFieldTest.php | 2 +- tests/lib/Integration/Console/StubPublishTest.php | 2 +- tests/lib/Integration/Routing/ActionsTest.php | 2 +- tests/lib/Integration/Routing/HasManyTest.php | 2 +- tests/lib/Integration/Routing/HasOneTest.php | 2 +- tests/lib/Integration/Routing/ResourceTest.php | 2 +- tests/lib/Integration/Routing/TestCase.php | 2 +- tests/lib/Integration/TestCase.php | 2 +- tests/lib/Unit/PackageTest.php | 2 +- 143 files changed, 143 insertions(+), 143 deletions(-) diff --git a/src/Console/Concerns/ResolvesStub.php b/src/Console/Concerns/ResolvesStub.php index fc63283..547c93f 100644 --- a/src/Console/Concerns/ResolvesStub.php +++ b/src/Console/Concerns/ResolvesStub.php @@ -1,6 +1,6 @@ Date: Wed, 14 Feb 2024 19:10:33 +0000 Subject: [PATCH 04/28] docs: update changelog and bump version --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f7e4aa..c4ba7c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ All notable changes to this project will be documented in this file. This projec ## Unreleased +## [3.2.0] - 2024-02-14 + ### Added - [#265](https://github.com/laravel-json-api/laravel/issues/265) Allow registration of middleware per action on both From be16a212cc44b12a3fcfbc489a92fd3fed75cb30 Mon Sep 17 00:00:00 2001 From: RobChatloop <148765742+RobChatloop@users.noreply.github.com> Date: Sun, 3 Mar 2024 12:44:42 +0000 Subject: [PATCH 05/28] feat: add support to replace model in resource stub (#272) --- src/Console/Concerns/ReplacesModel.php | 58 +++++++++++++++++++ src/Console/MakeResource.php | 16 ++++- src/Console/MakeSchema.php | 23 ++------ stubs/resource.stub | 8 ++- .../Integration/Console/MakeResourceTest.php | 37 +++++++++++- 5 files changed, 119 insertions(+), 23 deletions(-) create mode 100644 src/Console/Concerns/ReplacesModel.php diff --git a/src/Console/Concerns/ReplacesModel.php b/src/Console/Concerns/ReplacesModel.php new file mode 100644 index 0000000..753fc86 --- /dev/null +++ b/src/Console/Concerns/ReplacesModel.php @@ -0,0 +1,58 @@ +qualifyModel($model); + } + + $model = class_basename($model); + + $replace = [ + '{{ namespacedModel }}' => $namespacedModel, + '{{namespacedModel}}' => $namespacedModel, + '{{ model }}' => $model, + '{{model}}' => $model, + ]; + + return str_replace( + array_keys($replace), array_values($replace), $stub + ); + } +} diff --git a/src/Console/MakeResource.php b/src/Console/MakeResource.php index efb53cc..7c1d996 100644 --- a/src/Console/MakeResource.php +++ b/src/Console/MakeResource.php @@ -19,10 +19,12 @@ namespace LaravelJsonApi\Laravel\Console; +use LaravelJsonApi\Laravel\Console\Concerns\ReplacesModel; use Symfony\Component\Console\Input\InputOption; class MakeResource extends GeneratorCommand { + use ReplacesModel; /** * @var string @@ -52,6 +54,18 @@ protected function getStub() return $this->resolveStubPath('resource.stub'); } + /** + * @inheritDoc + */ + protected function buildClass($name) + { + $stub = parent::buildClass($name); + + $model = $this->option('model') ?: $this->guessModel(); + + return $this->replaceModel($stub, $model); + } + /** * @inheritDoc */ @@ -59,8 +73,8 @@ protected function getOptions() { return [ ['force', null, InputOption::VALUE_NONE, 'Create the class even if the resource already exists'], + ['model', 'm', InputOption::VALUE_REQUIRED, 'The model that the resource applies to.'], ['server', 's', InputOption::VALUE_REQUIRED, 'The JSON:API server the resource exists in.'], ]; } - } diff --git a/src/Console/MakeSchema.php b/src/Console/MakeSchema.php index d371e8b..79b83a4 100644 --- a/src/Console/MakeSchema.php +++ b/src/Console/MakeSchema.php @@ -19,7 +19,7 @@ namespace LaravelJsonApi\Laravel\Console; -use Illuminate\Support\Str; +use LaravelJsonApi\Laravel\Console\Concerns\ReplacesModel; use Symfony\Component\Console\Input\InputOption; use function array_keys; use function array_values; @@ -27,6 +27,7 @@ class MakeSchema extends GeneratorCommand { + use ReplacesModel; /** * @var string @@ -47,7 +48,7 @@ class MakeSchema extends GeneratorCommand * @var string */ protected $classType = 'Schema'; - + /** * @inheritDoc */ @@ -65,7 +66,7 @@ protected function getStub() */ protected function buildClass($name) { - $stub = parent::buildClass($name); + $stub = $this->replaceSchema(parent::buildClass($name)); $model = $this->option('model') ?: $this->guessModel(); @@ -77,24 +78,11 @@ protected function buildClass($name) * @param string $model * @return string */ - protected function replaceModel(string $stub, string $model): string + protected function replaceSchema(string $stub): string { - $model = str_replace('/', '\\', $model); - - if (Str::startsWith($model, '\\')) { - $namespacedModel = trim($model, '\\'); - } else { - $namespacedModel = $this->qualifyModel($model); - } - - $model = class_basename($model); $schema = $this->option('proxy') ? 'ProxySchema' : 'Schema'; $replace = [ - '{{ namespacedModel }}' => $namespacedModel, - '{{namespacedModel}}' => $namespacedModel, - '{{ model }}' => $model, - '{{model}}' => $model, '{{ schema }}' => $schema, '{{schema}}' => $schema, ]; @@ -117,5 +105,4 @@ protected function getOptions() ['server', 's', InputOption::VALUE_REQUIRED, 'The JSON:API server the schema exists in.'], ]; } - } diff --git a/stubs/resource.stub b/stubs/resource.stub index 0263f81..b8ab023 100644 --- a/stubs/resource.stub +++ b/stubs/resource.stub @@ -2,9 +2,13 @@ namespace {{ namespace }}; +use {{ namespacedModel }}; use Illuminate\Http\Request; use LaravelJsonApi\Core\Resources\JsonApiResource; +/** + * @property {{ model }} $resource + */ class {{ class }} extends JsonApiResource { @@ -17,8 +21,8 @@ class {{ class }} extends JsonApiResource public function attributes($request): iterable { return [ - 'createdAt' => $this->created_at, - 'updatedAt' => $this->updated_at, + 'createdAt' => $this->resource->created_at, + 'updatedAt' => $this->resource->updated_at, ]; } diff --git a/tests/lib/Integration/Console/MakeResourceTest.php b/tests/lib/Integration/Console/MakeResourceTest.php index 6cd48e0..0abc975 100644 --- a/tests/lib/Integration/Console/MakeResourceTest.php +++ b/tests/lib/Integration/Console/MakeResourceTest.php @@ -25,7 +25,6 @@ class MakeResourceTest extends TestCase { - /** * @return void */ @@ -60,6 +59,33 @@ public function test(): void $this->assertResourceCreated(); } + public function testModelWithoutNamespace(): void + { + config()->set('jsonapi.servers', [ + 'v1' => Server::class, + ]); + + $result = $this->artisan('jsonapi:resource posts --model BlogPost'); + + $this->assertSame(0, $result); + $this->assertResourceCreated('App\Models\BlogPost', 'BlogPost'); + } + + public function testModelWithNamespace(): void + { + config()->set('jsonapi.servers', [ + 'v1' => Server::class, + ]); + + $result = $this->artisan('jsonapi:resource', [ + 'name' => 'posts', + '--model' => '\App\Foo\Bar\BlogPost', + ]); + + $this->assertSame(0, $result); + $this->assertResourceCreated('App\Foo\Bar\BlogPost', 'BlogPost'); + } + public function testServer(): void { config()->set('jsonapi.servers', [ @@ -104,9 +130,14 @@ public function testInvalidServer(): void } /** + * @param string $namespacedModel + * @param string $model * @return void */ - private function assertResourceCreated(): void + private function assertResourceCreated( + string $namespacedModel = 'App\Models\Post', + string $model = 'Post' + ): void { $this->assertFileExists($path = app_path('JsonApi/V1/Posts/PostResource.php')); $content = file_get_contents($path); @@ -115,6 +146,8 @@ private function assertResourceCreated(): void 'namespace App\JsonApi\V1\Posts;', 'use LaravelJsonApi\Core\Resources\JsonApiResource;', 'class PostResource extends JsonApiResource', + "use {$namespacedModel};", + "@property {$model} \$resource", ]; foreach ($tests as $expected) { From b1782a529ed62cc04a92e9edb9ccb61d0a1a2608 Mon Sep 17 00:00:00 2001 From: Christopher Gammie Date: Sun, 3 Mar 2024 12:48:13 +0000 Subject: [PATCH 06/28] docs: update changelog and bump version --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c4ba7c5..168869a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file. This projec ## Unreleased +## [3.3.0] - 2024-03-03 + +### Added + +- [#272](https://github.com/laravel-json-api/laravel/pull/272) Added a model property type-hint to the resource stub and + allowed it to be replaced via a model option on the command. + ## [3.2.0] - 2024-02-14 ### Added From 67c90374be14b2077eae242799a86b1d8b5496c2 Mon Sep 17 00:00:00 2001 From: Christopher Gammie Date: Sun, 3 Mar 2024 12:49:20 +0000 Subject: [PATCH 07/28] docs: fix versions in changelog --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 168869a..76bd4a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,14 +5,14 @@ All notable changes to this project will be documented in this file. This projec ## Unreleased -## [3.3.0] - 2024-03-03 +## [3.4.0] - 2024-03-03 ### Added - [#272](https://github.com/laravel-json-api/laravel/pull/272) Added a model property type-hint to the resource stub and allowed it to be replaced via a model option on the command. -## [3.2.0] - 2024-02-14 +## [3.3.0] - 2024-02-14 ### Added From 37e18311f984e0419397cf1da507fe1f29e2f5e3 Mon Sep 17 00:00:00 2001 From: Christopher Gammie Date: Thu, 14 Mar 2024 18:03:20 +0000 Subject: [PATCH 08/28] feat!: upgrade to Laravel 11 and drop PHP 8.1 (#267) --- .github/workflows/tests.yml | 4 ++-- .gitignore | 3 +-- CHANGELOG.md | 5 +++++ composer.json | 24 ++++++++++++------------ 4 files changed, 20 insertions(+), 16 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3d8abe3..843531a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -14,8 +14,8 @@ jobs: strategy: fail-fast: true matrix: - php: [8.1, 8.2, 8.3] - laravel: [10] + php: [8.2, 8.3] + laravel: [11] steps: - name: Checkout Code diff --git a/.gitignore b/.gitignore index 62b9c43..9448440 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ /dummy vendor/ composer.lock -.phpunit.result.cache -.phpunit.cache +.phpunit.cache/ diff --git a/CHANGELOG.md b/CHANGELOG.md index 76bd4a8..753de24 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file. This projec ## Unreleased +### Changed + +- **BREAKING** Package now requires Laravel 11. +- Minimum PHP version is now `8.2`. + ## [3.4.0] - 2024-03-03 ### Added diff --git a/composer.json b/composer.json index 4be1273..5a308e0 100644 --- a/composer.json +++ b/composer.json @@ -23,20 +23,20 @@ } ], "require": { - "php": "^8.1", + "php": "^8.2", "ext-json": "*", - "laravel-json-api/core": "^3.3", - "laravel-json-api/eloquent": "^3.1", - "laravel-json-api/encoder-neomerx": "^3.1", - "laravel-json-api/exceptions": "^2.1", - "laravel-json-api/spec": "^2.0", - "laravel-json-api/validation": "^3.0", - "laravel/framework": "^10.0" + "laravel-json-api/core": "^4.0", + "laravel-json-api/eloquent": "^4.0", + "laravel-json-api/encoder-neomerx": "^4.0", + "laravel-json-api/exceptions": "^3.0", + "laravel-json-api/spec": "^3.0", + "laravel-json-api/validation": "^4.0", + "laravel/framework": "^11.0" }, "require-dev": { - "laravel-json-api/testing": "^2.1", - "orchestra/testbench": "^8.0", - "phpunit/phpunit": "^10.0" + "laravel-json-api/testing": "^3.0", + "orchestra/testbench": "^9.0", + "phpunit/phpunit": "^10.5" }, "autoload": { "psr-4": { @@ -53,7 +53,7 @@ }, "extra": { "branch-alias": { - "dev-develop": "3.x-dev" + "dev-develop": "4.x-dev" }, "laravel": { "aliases": { From 005c85c4f24a3c0e093d3c9d781bd424e229ab96 Mon Sep 17 00:00:00 2001 From: Christopher Gammie Date: Thu, 14 Mar 2024 18:08:42 +0000 Subject: [PATCH 09/28] docs: change to an MIT licence --- CHANGELOG.md | 1 + LICENSE | 223 ++---------------- README.md | 2 +- composer.json | 2 +- src/Console/Concerns/ReplacesModel.php | 14 +- src/Console/Concerns/ResolvesStub.php | 14 +- src/Console/GeneratorCommand.php | 14 +- src/Console/MakeAuthorizer.php | 14 +- src/Console/MakeController.php | 14 +- src/Console/MakeFilter.php | 14 +- src/Console/MakeQuery.php | 14 +- src/Console/MakeRequest.php | 14 +- src/Console/MakeRequests.php | 14 +- src/Console/MakeResource.php | 14 +- src/Console/MakeSchema.php | 14 +- src/Console/MakeServer.php | 14 +- src/Console/MakeSortField.php | 14 +- src/Console/StubPublish.php | 14 +- src/Exceptions/HttpNotAcceptableException.php | 14 +- .../HttpUnsupportedMediaTypeException.php | 14 +- src/Facades/JsonApiRoute.php | 14 +- .../Actions/AttachRelationship.php | 14 +- src/Http/Controllers/Actions/Destroy.php | 14 +- .../Actions/DetachRelationship.php | 14 +- src/Http/Controllers/Actions/FetchMany.php | 14 +- src/Http/Controllers/Actions/FetchOne.php | 14 +- src/Http/Controllers/Actions/FetchRelated.php | 14 +- .../Controllers/Actions/FetchRelationship.php | 14 +- src/Http/Controllers/Actions/Store.php | 14 +- src/Http/Controllers/Actions/Update.php | 14 +- .../Actions/UpdateRelationship.php | 14 +- src/Http/Controllers/JsonApiController.php | 14 +- src/Http/Middleware/BootJsonApi.php | 14 +- .../Requests/AnonymousCollectionQuery.php | 14 +- src/Http/Requests/AnonymousQuery.php | 14 +- src/Http/Requests/FormRequest.php | 14 +- src/Http/Requests/RequestResolver.php | 14 +- src/Http/Requests/ResourceQuery.php | 14 +- src/Http/Requests/ResourceRequest.php | 14 +- src/LaravelJsonApi.php | 14 +- src/Routing/ActionProxy.php | 14 +- src/Routing/ActionRegistrar.php | 14 +- .../PendingRelationshipRegistration.php | 14 +- src/Routing/PendingResourceRegistration.php | 14 +- src/Routing/PendingServerRegistration.php | 14 +- src/Routing/Registrar.php | 14 +- src/Routing/RelationshipRegistrar.php | 14 +- src/Routing/Relationships.php | 14 +- src/Routing/ResourceRegistrar.php | 14 +- src/Routing/Route.php | 14 +- src/ServiceProvider.php | 14 +- .../Controllers/Api/V1/PostController.php | 14 +- .../Controllers/Api/V1/UserController.php | 14 +- .../Controllers/Api/V1/VideoController.php | 14 +- .../dummy/app/Http/Controllers/Controller.php | 14 +- .../app/JsonApi/V1/Comments/CommentSchema.php | 14 +- .../app/JsonApi/V1/Images/ImageSchema.php | 14 +- .../JsonApi/V1/Media/MediaCollectionQuery.php | 14 +- .../app/JsonApi/V1/Phones/PhoneSchema.php | 14 +- .../JsonApi/V1/Posts/PostCollectionQuery.php | 14 +- .../dummy/app/JsonApi/V1/Posts/PostQuery.php | 14 +- .../app/JsonApi/V1/Posts/PostRequest.php | 14 +- .../dummy/app/JsonApi/V1/Posts/PostSchema.php | 14 +- .../dummy/app/JsonApi/V1/Posts/PostScope.php | 14 +- tests/dummy/app/JsonApi/V1/Server.php | 14 +- tests/dummy/app/JsonApi/V1/Tags/TagSchema.php | 14 +- .../dummy/app/JsonApi/V1/Users/UserQuery.php | 14 +- .../app/JsonApi/V1/Users/UserRequest.php | 14 +- .../dummy/app/JsonApi/V1/Users/UserSchema.php | 14 +- .../app/JsonApi/V1/Videos/VideoRequest.php | 14 +- .../app/JsonApi/V1/Videos/VideoSchema.php | 14 +- tests/dummy/app/Models/Comment.php | 14 +- tests/dummy/app/Models/Image.php | 14 +- tests/dummy/app/Models/Phone.php | 14 +- tests/dummy/app/Models/Post.php | 14 +- tests/dummy/app/Models/Tag.php | 14 +- tests/dummy/app/Models/User.php | 14 +- tests/dummy/app/Models/Video.php | 14 +- tests/dummy/app/Policies/PostPolicy.php | 14 +- tests/dummy/app/Policies/UserPolicy.php | 14 +- tests/dummy/app/Policies/VideoPolicy.php | 14 +- .../app/Providers/AppServiceProvider.php | 14 +- .../app/Providers/AuthServiceProvider.php | 14 +- .../app/Providers/EventServiceProvider.php | 14 +- .../app/Providers/RouteServiceProvider.php | 14 +- tests/dummy/config/jsonapi.php | 14 +- .../database/factories/CommentFactory.php | 14 +- .../dummy/database/factories/ImageFactory.php | 14 +- .../dummy/database/factories/PhoneFactory.php | 14 +- .../dummy/database/factories/PostFactory.php | 14 +- tests/dummy/database/factories/TagFactory.php | 14 +- .../dummy/database/factories/UserFactory.php | 14 +- .../dummy/database/factories/VideoFactory.php | 14 +- ...13_143800_create_post_and_video_tables.php | 14 +- .../2022_06_25_115000_create_phones_table.php | 14 +- tests/dummy/routes/api.php | 14 +- tests/dummy/routes/web.php | 14 +- .../Api/V1/Posts/Actions/PublishTest.php | 14 +- .../tests/Api/V1/Posts/Actions/PurgeTest.php | 14 +- .../tests/Api/V1/Posts/AttachMediaTest.php | 14 +- .../tests/Api/V1/Posts/AttachTagsTest.php | 14 +- tests/dummy/tests/Api/V1/Posts/CreateTest.php | 14 +- tests/dummy/tests/Api/V1/Posts/DeleteTest.php | 14 +- .../tests/Api/V1/Posts/DetachMediaTest.php | 14 +- .../tests/Api/V1/Posts/DetachTagsTest.php | 14 +- tests/dummy/tests/Api/V1/Posts/IndexTest.php | 14 +- .../Api/V1/Posts/ReadAuthorIdentifierTest.php | 14 +- .../tests/Api/V1/Posts/ReadAuthorTest.php | 14 +- .../V1/Posts/ReadCommentIdentifiersTest.php | 14 +- .../tests/Api/V1/Posts/ReadCommentsTest.php | 14 +- .../tests/Api/V1/Posts/ReadMediaTest.php | 14 +- .../Api/V1/Posts/ReadTagIdentifiersTest.php | 14 +- .../dummy/tests/Api/V1/Posts/ReadTagsTest.php | 14 +- tests/dummy/tests/Api/V1/Posts/ReadTest.php | 14 +- .../tests/Api/V1/Posts/UpdateMediaTest.php | 14 +- .../tests/Api/V1/Posts/UpdateTagsTest.php | 14 +- tests/dummy/tests/Api/V1/Posts/UpdateTest.php | 14 +- tests/dummy/tests/Api/V1/Serializer.php | 14 +- tests/dummy/tests/Api/V1/TestCase.php | 14 +- tests/dummy/tests/Api/V1/Users/ReadTest.php | 14 +- .../tests/Api/V1/Users/UpdatePhoneTest.php | 14 +- .../dummy/tests/Api/V1/Videos/CreateTest.php | 14 +- tests/dummy/tests/TestCase.php | 14 +- .../Acceptance/DefaultIncludePaths/Test.php | 14 +- .../DefaultIncludePaths/TestRequest.php | 14 +- .../Relationships/ToManyLinksTest.php | 14 +- .../Relationships/ToOneLinksTest.php | 14 +- .../lib/Acceptance/RequestBodyContentTest.php | 14 +- tests/lib/Acceptance/ResponseTest.php | 14 +- tests/lib/Acceptance/TestCase.php | 14 +- .../Console/MakeAuthorizerTest.php | 14 +- .../Console/MakeControllerTest.php | 14 +- .../Integration/Console/MakeFilterTest.php | 14 +- .../lib/Integration/Console/MakeQueryTest.php | 14 +- .../Integration/Console/MakeRequestTest.php | 14 +- .../Integration/Console/MakeRequestsTest.php | 14 +- .../Integration/Console/MakeResourceTest.php | 14 +- .../Integration/Console/MakeSchemaTest.php | 14 +- .../Integration/Console/MakeServerTest.php | 14 +- .../Integration/Console/MakeSortFieldTest.php | 14 +- .../Integration/Console/StubPublishTest.php | 14 +- tests/lib/Integration/Routing/ActionsTest.php | 14 +- tests/lib/Integration/Routing/HasManyTest.php | 14 +- tests/lib/Integration/Routing/HasOneTest.php | 14 +- .../lib/Integration/Routing/ResourceTest.php | 14 +- tests/lib/Integration/Routing/TestCase.php | 14 +- tests/lib/Integration/TestCase.php | 14 +- tests/lib/Unit/PackageTest.php | 14 +- 148 files changed, 456 insertions(+), 1788 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 753de24..0637f8b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ All notable changes to this project will be documented in this file. This projec ### Changed +- Package is now licensed under the MIT License. - **BREAKING** Package now requires Laravel 11. - Minimum PHP version is now `8.2`. diff --git a/LICENSE b/LICENSE index 7218413..c587f9b 100644 --- a/LICENSE +++ b/LICENSE @@ -1,202 +1,21 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2020 Cloud Creativity Limited. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. +The MIT License (MIT) + +Copyright (c) 2024 Cloud Creativity Ltd + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md index 2808bcd..50ef5fa 100644 --- a/README.md +++ b/README.md @@ -129,4 +129,4 @@ To view an example Laravel application that uses this package, see the ## License -Laravel JSON:API is open-sourced software licensed under the [Apache 2.0 License](./LICENSE). +Laravel JSON:API is open-sourced software licensed under the [MIT License](./LICENSE). diff --git a/composer.json b/composer.json index 5a308e0..a09de20 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,7 @@ "support": { "issues": "https://github.com/laravel-json-api/laravel/issues" }, - "license": "Apache-2.0", + "license": "MIT", "authors": [ { "name": "Cloud Creativity Ltd", diff --git a/src/Console/Concerns/ReplacesModel.php b/src/Console/Concerns/ReplacesModel.php index 753fc86..b1c47c1 100644 --- a/src/Console/Concerns/ReplacesModel.php +++ b/src/Console/Concerns/ReplacesModel.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/src/Console/Concerns/ResolvesStub.php b/src/Console/Concerns/ResolvesStub.php index 547c93f..45094fa 100644 --- a/src/Console/Concerns/ResolvesStub.php +++ b/src/Console/Concerns/ResolvesStub.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/src/Console/GeneratorCommand.php b/src/Console/GeneratorCommand.php index ef58a92..0fc0e9e 100644 --- a/src/Console/GeneratorCommand.php +++ b/src/Console/GeneratorCommand.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/src/Console/MakeAuthorizer.php b/src/Console/MakeAuthorizer.php index 39852f2..e3fc699 100644 --- a/src/Console/MakeAuthorizer.php +++ b/src/Console/MakeAuthorizer.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/src/Console/MakeController.php b/src/Console/MakeController.php index fbf11b8..b3bfce1 100644 --- a/src/Console/MakeController.php +++ b/src/Console/MakeController.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/src/Console/MakeFilter.php b/src/Console/MakeFilter.php index 8fa6280..4c1fa02 100644 --- a/src/Console/MakeFilter.php +++ b/src/Console/MakeFilter.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/src/Console/MakeQuery.php b/src/Console/MakeQuery.php index 126e082..0cbe922 100644 --- a/src/Console/MakeQuery.php +++ b/src/Console/MakeQuery.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/src/Console/MakeRequest.php b/src/Console/MakeRequest.php index 31fb239..f8b1be5 100644 --- a/src/Console/MakeRequest.php +++ b/src/Console/MakeRequest.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/src/Console/MakeRequests.php b/src/Console/MakeRequests.php index 4792dbc..f941f99 100644 --- a/src/Console/MakeRequests.php +++ b/src/Console/MakeRequests.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/src/Console/MakeResource.php b/src/Console/MakeResource.php index 7c1d996..f016c90 100644 --- a/src/Console/MakeResource.php +++ b/src/Console/MakeResource.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/src/Console/MakeSchema.php b/src/Console/MakeSchema.php index 79b83a4..764a4cc 100644 --- a/src/Console/MakeSchema.php +++ b/src/Console/MakeSchema.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/src/Console/MakeServer.php b/src/Console/MakeServer.php index 4eccb01..2a27fee 100644 --- a/src/Console/MakeServer.php +++ b/src/Console/MakeServer.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/src/Console/MakeSortField.php b/src/Console/MakeSortField.php index 2733827..0419ce4 100644 --- a/src/Console/MakeSortField.php +++ b/src/Console/MakeSortField.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/src/Console/StubPublish.php b/src/Console/StubPublish.php index 1c028ac..2c6af08 100644 --- a/src/Console/StubPublish.php +++ b/src/Console/StubPublish.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ namespace LaravelJsonApi\Laravel\Console; diff --git a/src/Exceptions/HttpNotAcceptableException.php b/src/Exceptions/HttpNotAcceptableException.php index 409e9b7..ea6384d 100644 --- a/src/Exceptions/HttpNotAcceptableException.php +++ b/src/Exceptions/HttpNotAcceptableException.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/src/Exceptions/HttpUnsupportedMediaTypeException.php b/src/Exceptions/HttpUnsupportedMediaTypeException.php index 5a7b0c3..cf89247 100644 --- a/src/Exceptions/HttpUnsupportedMediaTypeException.php +++ b/src/Exceptions/HttpUnsupportedMediaTypeException.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/src/Facades/JsonApiRoute.php b/src/Facades/JsonApiRoute.php index c68c621..9b2cd7b 100644 --- a/src/Facades/JsonApiRoute.php +++ b/src/Facades/JsonApiRoute.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/src/Http/Controllers/Actions/AttachRelationship.php b/src/Http/Controllers/Actions/AttachRelationship.php index 2fbc3ea..eeaa6f6 100644 --- a/src/Http/Controllers/Actions/AttachRelationship.php +++ b/src/Http/Controllers/Actions/AttachRelationship.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/src/Http/Controllers/Actions/Destroy.php b/src/Http/Controllers/Actions/Destroy.php index ec69397..8ab981b 100644 --- a/src/Http/Controllers/Actions/Destroy.php +++ b/src/Http/Controllers/Actions/Destroy.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/src/Http/Controllers/Actions/DetachRelationship.php b/src/Http/Controllers/Actions/DetachRelationship.php index 4baf920..4febd0a 100644 --- a/src/Http/Controllers/Actions/DetachRelationship.php +++ b/src/Http/Controllers/Actions/DetachRelationship.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/src/Http/Controllers/Actions/FetchMany.php b/src/Http/Controllers/Actions/FetchMany.php index ee003de..9a2eb13 100644 --- a/src/Http/Controllers/Actions/FetchMany.php +++ b/src/Http/Controllers/Actions/FetchMany.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/src/Http/Controllers/Actions/FetchOne.php b/src/Http/Controllers/Actions/FetchOne.php index 5ca1725..1c091b8 100644 --- a/src/Http/Controllers/Actions/FetchOne.php +++ b/src/Http/Controllers/Actions/FetchOne.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/src/Http/Controllers/Actions/FetchRelated.php b/src/Http/Controllers/Actions/FetchRelated.php index 4d63a24..354fe01 100644 --- a/src/Http/Controllers/Actions/FetchRelated.php +++ b/src/Http/Controllers/Actions/FetchRelated.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/src/Http/Controllers/Actions/FetchRelationship.php b/src/Http/Controllers/Actions/FetchRelationship.php index 55ad6b6..c9f4d72 100644 --- a/src/Http/Controllers/Actions/FetchRelationship.php +++ b/src/Http/Controllers/Actions/FetchRelationship.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/src/Http/Controllers/Actions/Store.php b/src/Http/Controllers/Actions/Store.php index b05d460..07a5fd7 100644 --- a/src/Http/Controllers/Actions/Store.php +++ b/src/Http/Controllers/Actions/Store.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/src/Http/Controllers/Actions/Update.php b/src/Http/Controllers/Actions/Update.php index 001cf12..b65c0d5 100644 --- a/src/Http/Controllers/Actions/Update.php +++ b/src/Http/Controllers/Actions/Update.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/src/Http/Controllers/Actions/UpdateRelationship.php b/src/Http/Controllers/Actions/UpdateRelationship.php index 09c3f47..245a6eb 100644 --- a/src/Http/Controllers/Actions/UpdateRelationship.php +++ b/src/Http/Controllers/Actions/UpdateRelationship.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/src/Http/Controllers/JsonApiController.php b/src/Http/Controllers/JsonApiController.php index f04c4c4..5fa75cc 100644 --- a/src/Http/Controllers/JsonApiController.php +++ b/src/Http/Controllers/JsonApiController.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/src/Http/Middleware/BootJsonApi.php b/src/Http/Middleware/BootJsonApi.php index 08cd487..b65602a 100644 --- a/src/Http/Middleware/BootJsonApi.php +++ b/src/Http/Middleware/BootJsonApi.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/src/Http/Requests/AnonymousCollectionQuery.php b/src/Http/Requests/AnonymousCollectionQuery.php index 2cc9da8..3363b32 100644 --- a/src/Http/Requests/AnonymousCollectionQuery.php +++ b/src/Http/Requests/AnonymousCollectionQuery.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ namespace LaravelJsonApi\Laravel\Http\Requests; diff --git a/src/Http/Requests/AnonymousQuery.php b/src/Http/Requests/AnonymousQuery.php index a07b3c1..028aa66 100644 --- a/src/Http/Requests/AnonymousQuery.php +++ b/src/Http/Requests/AnonymousQuery.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ namespace LaravelJsonApi\Laravel\Http\Requests; diff --git a/src/Http/Requests/FormRequest.php b/src/Http/Requests/FormRequest.php index f9787d6..1ff4f8e 100644 --- a/src/Http/Requests/FormRequest.php +++ b/src/Http/Requests/FormRequest.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/src/Http/Requests/RequestResolver.php b/src/Http/Requests/RequestResolver.php index 88ff821..731576c 100644 --- a/src/Http/Requests/RequestResolver.php +++ b/src/Http/Requests/RequestResolver.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/src/Http/Requests/ResourceQuery.php b/src/Http/Requests/ResourceQuery.php index 157d7b8..116d5b9 100644 --- a/src/Http/Requests/ResourceQuery.php +++ b/src/Http/Requests/ResourceQuery.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/src/Http/Requests/ResourceRequest.php b/src/Http/Requests/ResourceRequest.php index 22955d9..7a0a267 100644 --- a/src/Http/Requests/ResourceRequest.php +++ b/src/Http/Requests/ResourceRequest.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/src/LaravelJsonApi.php b/src/LaravelJsonApi.php index 0a21dc1..64e047e 100644 --- a/src/LaravelJsonApi.php +++ b/src/LaravelJsonApi.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/src/Routing/ActionProxy.php b/src/Routing/ActionProxy.php index 15abb81..443b0eb 100644 --- a/src/Routing/ActionProxy.php +++ b/src/Routing/ActionProxy.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/src/Routing/ActionRegistrar.php b/src/Routing/ActionRegistrar.php index 26e2400..c259278 100644 --- a/src/Routing/ActionRegistrar.php +++ b/src/Routing/ActionRegistrar.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/src/Routing/PendingRelationshipRegistration.php b/src/Routing/PendingRelationshipRegistration.php index c655acc..8bffb48 100644 --- a/src/Routing/PendingRelationshipRegistration.php +++ b/src/Routing/PendingRelationshipRegistration.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/src/Routing/PendingResourceRegistration.php b/src/Routing/PendingResourceRegistration.php index ac379f4..c98fa02 100644 --- a/src/Routing/PendingResourceRegistration.php +++ b/src/Routing/PendingResourceRegistration.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/src/Routing/PendingServerRegistration.php b/src/Routing/PendingServerRegistration.php index ed29aaf..0e66bd9 100644 --- a/src/Routing/PendingServerRegistration.php +++ b/src/Routing/PendingServerRegistration.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/src/Routing/Registrar.php b/src/Routing/Registrar.php index f68f9e3..61b23e3 100644 --- a/src/Routing/Registrar.php +++ b/src/Routing/Registrar.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/src/Routing/RelationshipRegistrar.php b/src/Routing/RelationshipRegistrar.php index 397bed3..4aaa6fb 100644 --- a/src/Routing/RelationshipRegistrar.php +++ b/src/Routing/RelationshipRegistrar.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/src/Routing/Relationships.php b/src/Routing/Relationships.php index 1890f86..9b967f7 100644 --- a/src/Routing/Relationships.php +++ b/src/Routing/Relationships.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/src/Routing/ResourceRegistrar.php b/src/Routing/ResourceRegistrar.php index 51a7e69..265fc79 100644 --- a/src/Routing/ResourceRegistrar.php +++ b/src/Routing/ResourceRegistrar.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/src/Routing/Route.php b/src/Routing/Route.php index 01b1d24..ca037a7 100644 --- a/src/Routing/Route.php +++ b/src/Routing/Route.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/src/ServiceProvider.php b/src/ServiceProvider.php index a95f893..b71c3cf 100644 --- a/src/ServiceProvider.php +++ b/src/ServiceProvider.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/tests/dummy/app/Http/Controllers/Api/V1/PostController.php b/tests/dummy/app/Http/Controllers/Api/V1/PostController.php index 365b55e..efafb8c 100644 --- a/tests/dummy/app/Http/Controllers/Api/V1/PostController.php +++ b/tests/dummy/app/Http/Controllers/Api/V1/PostController.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/tests/dummy/app/Http/Controllers/Api/V1/UserController.php b/tests/dummy/app/Http/Controllers/Api/V1/UserController.php index 4b4addb..0975510 100644 --- a/tests/dummy/app/Http/Controllers/Api/V1/UserController.php +++ b/tests/dummy/app/Http/Controllers/Api/V1/UserController.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/tests/dummy/app/Http/Controllers/Api/V1/VideoController.php b/tests/dummy/app/Http/Controllers/Api/V1/VideoController.php index fa8f748..9653bba 100644 --- a/tests/dummy/app/Http/Controllers/Api/V1/VideoController.php +++ b/tests/dummy/app/Http/Controllers/Api/V1/VideoController.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/tests/dummy/app/Http/Controllers/Controller.php b/tests/dummy/app/Http/Controllers/Controller.php index 948f5ff..26615ce 100644 --- a/tests/dummy/app/Http/Controllers/Controller.php +++ b/tests/dummy/app/Http/Controllers/Controller.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ namespace App\Http\Controllers; diff --git a/tests/dummy/app/JsonApi/V1/Comments/CommentSchema.php b/tests/dummy/app/JsonApi/V1/Comments/CommentSchema.php index f0b2084..6ad6366 100644 --- a/tests/dummy/app/JsonApi/V1/Comments/CommentSchema.php +++ b/tests/dummy/app/JsonApi/V1/Comments/CommentSchema.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/tests/dummy/app/JsonApi/V1/Images/ImageSchema.php b/tests/dummy/app/JsonApi/V1/Images/ImageSchema.php index 2b8f193..02aba0e 100644 --- a/tests/dummy/app/JsonApi/V1/Images/ImageSchema.php +++ b/tests/dummy/app/JsonApi/V1/Images/ImageSchema.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/tests/dummy/app/JsonApi/V1/Media/MediaCollectionQuery.php b/tests/dummy/app/JsonApi/V1/Media/MediaCollectionQuery.php index ed8ce50..1a9cbde 100644 --- a/tests/dummy/app/JsonApi/V1/Media/MediaCollectionQuery.php +++ b/tests/dummy/app/JsonApi/V1/Media/MediaCollectionQuery.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/tests/dummy/app/JsonApi/V1/Phones/PhoneSchema.php b/tests/dummy/app/JsonApi/V1/Phones/PhoneSchema.php index d8f988c..c237ca3 100644 --- a/tests/dummy/app/JsonApi/V1/Phones/PhoneSchema.php +++ b/tests/dummy/app/JsonApi/V1/Phones/PhoneSchema.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/tests/dummy/app/JsonApi/V1/Posts/PostCollectionQuery.php b/tests/dummy/app/JsonApi/V1/Posts/PostCollectionQuery.php index d96a9cc..d66bb64 100644 --- a/tests/dummy/app/JsonApi/V1/Posts/PostCollectionQuery.php +++ b/tests/dummy/app/JsonApi/V1/Posts/PostCollectionQuery.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/tests/dummy/app/JsonApi/V1/Posts/PostQuery.php b/tests/dummy/app/JsonApi/V1/Posts/PostQuery.php index 19a95b4..872d6ec 100644 --- a/tests/dummy/app/JsonApi/V1/Posts/PostQuery.php +++ b/tests/dummy/app/JsonApi/V1/Posts/PostQuery.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/tests/dummy/app/JsonApi/V1/Posts/PostRequest.php b/tests/dummy/app/JsonApi/V1/Posts/PostRequest.php index 7c790c7..c0f9ebc 100644 --- a/tests/dummy/app/JsonApi/V1/Posts/PostRequest.php +++ b/tests/dummy/app/JsonApi/V1/Posts/PostRequest.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/tests/dummy/app/JsonApi/V1/Posts/PostSchema.php b/tests/dummy/app/JsonApi/V1/Posts/PostSchema.php index a3a4f34..ca9abd6 100644 --- a/tests/dummy/app/JsonApi/V1/Posts/PostSchema.php +++ b/tests/dummy/app/JsonApi/V1/Posts/PostSchema.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/tests/dummy/app/JsonApi/V1/Posts/PostScope.php b/tests/dummy/app/JsonApi/V1/Posts/PostScope.php index a2dc740..b001bbf 100644 --- a/tests/dummy/app/JsonApi/V1/Posts/PostScope.php +++ b/tests/dummy/app/JsonApi/V1/Posts/PostScope.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/tests/dummy/app/JsonApi/V1/Server.php b/tests/dummy/app/JsonApi/V1/Server.php index 3a9f23c..b8b51f6 100644 --- a/tests/dummy/app/JsonApi/V1/Server.php +++ b/tests/dummy/app/JsonApi/V1/Server.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/tests/dummy/app/JsonApi/V1/Tags/TagSchema.php b/tests/dummy/app/JsonApi/V1/Tags/TagSchema.php index 00c44d7..99a5d89 100644 --- a/tests/dummy/app/JsonApi/V1/Tags/TagSchema.php +++ b/tests/dummy/app/JsonApi/V1/Tags/TagSchema.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/tests/dummy/app/JsonApi/V1/Users/UserQuery.php b/tests/dummy/app/JsonApi/V1/Users/UserQuery.php index e33684f..228fa6a 100644 --- a/tests/dummy/app/JsonApi/V1/Users/UserQuery.php +++ b/tests/dummy/app/JsonApi/V1/Users/UserQuery.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ namespace App\JsonApi\V1\Users; diff --git a/tests/dummy/app/JsonApi/V1/Users/UserRequest.php b/tests/dummy/app/JsonApi/V1/Users/UserRequest.php index 7971dff..bc64190 100644 --- a/tests/dummy/app/JsonApi/V1/Users/UserRequest.php +++ b/tests/dummy/app/JsonApi/V1/Users/UserRequest.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/tests/dummy/app/JsonApi/V1/Users/UserSchema.php b/tests/dummy/app/JsonApi/V1/Users/UserSchema.php index 910dee0..69436ca 100644 --- a/tests/dummy/app/JsonApi/V1/Users/UserSchema.php +++ b/tests/dummy/app/JsonApi/V1/Users/UserSchema.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/tests/dummy/app/JsonApi/V1/Videos/VideoRequest.php b/tests/dummy/app/JsonApi/V1/Videos/VideoRequest.php index dc114a8..aeb1fce 100644 --- a/tests/dummy/app/JsonApi/V1/Videos/VideoRequest.php +++ b/tests/dummy/app/JsonApi/V1/Videos/VideoRequest.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/tests/dummy/app/JsonApi/V1/Videos/VideoSchema.php b/tests/dummy/app/JsonApi/V1/Videos/VideoSchema.php index 001d053..908fdf1 100644 --- a/tests/dummy/app/JsonApi/V1/Videos/VideoSchema.php +++ b/tests/dummy/app/JsonApi/V1/Videos/VideoSchema.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/tests/dummy/app/Models/Comment.php b/tests/dummy/app/Models/Comment.php index 18b17cc..b6cf08e 100644 --- a/tests/dummy/app/Models/Comment.php +++ b/tests/dummy/app/Models/Comment.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/tests/dummy/app/Models/Image.php b/tests/dummy/app/Models/Image.php index 8cfcdd2..c0ba591 100644 --- a/tests/dummy/app/Models/Image.php +++ b/tests/dummy/app/Models/Image.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/tests/dummy/app/Models/Phone.php b/tests/dummy/app/Models/Phone.php index 822ecf3..156f4ff 100644 --- a/tests/dummy/app/Models/Phone.php +++ b/tests/dummy/app/Models/Phone.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/tests/dummy/app/Models/Post.php b/tests/dummy/app/Models/Post.php index 231338f..fff112f 100644 --- a/tests/dummy/app/Models/Post.php +++ b/tests/dummy/app/Models/Post.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ namespace App\Models; diff --git a/tests/dummy/app/Models/Tag.php b/tests/dummy/app/Models/Tag.php index 035683b..861cb5c 100644 --- a/tests/dummy/app/Models/Tag.php +++ b/tests/dummy/app/Models/Tag.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/tests/dummy/app/Models/User.php b/tests/dummy/app/Models/User.php index e61fcec..82b8356 100644 --- a/tests/dummy/app/Models/User.php +++ b/tests/dummy/app/Models/User.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ namespace App\Models; diff --git a/tests/dummy/app/Models/Video.php b/tests/dummy/app/Models/Video.php index 16f2f69..f4c738d 100644 --- a/tests/dummy/app/Models/Video.php +++ b/tests/dummy/app/Models/Video.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/tests/dummy/app/Policies/PostPolicy.php b/tests/dummy/app/Policies/PostPolicy.php index 46cbeaf..64deea4 100644 --- a/tests/dummy/app/Policies/PostPolicy.php +++ b/tests/dummy/app/Policies/PostPolicy.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/tests/dummy/app/Policies/UserPolicy.php b/tests/dummy/app/Policies/UserPolicy.php index 6d69609..6c3e233 100644 --- a/tests/dummy/app/Policies/UserPolicy.php +++ b/tests/dummy/app/Policies/UserPolicy.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/tests/dummy/app/Policies/VideoPolicy.php b/tests/dummy/app/Policies/VideoPolicy.php index a6e0659..a5dd156 100644 --- a/tests/dummy/app/Policies/VideoPolicy.php +++ b/tests/dummy/app/Policies/VideoPolicy.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/tests/dummy/app/Providers/AppServiceProvider.php b/tests/dummy/app/Providers/AppServiceProvider.php index 898eee0..e2cf598 100644 --- a/tests/dummy/app/Providers/AppServiceProvider.php +++ b/tests/dummy/app/Providers/AppServiceProvider.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ namespace App\Providers; diff --git a/tests/dummy/app/Providers/AuthServiceProvider.php b/tests/dummy/app/Providers/AuthServiceProvider.php index d4c8f9b..42b9379 100644 --- a/tests/dummy/app/Providers/AuthServiceProvider.php +++ b/tests/dummy/app/Providers/AuthServiceProvider.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ namespace App\Providers; diff --git a/tests/dummy/app/Providers/EventServiceProvider.php b/tests/dummy/app/Providers/EventServiceProvider.php index 0a8748f..3c1fef6 100644 --- a/tests/dummy/app/Providers/EventServiceProvider.php +++ b/tests/dummy/app/Providers/EventServiceProvider.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ namespace App\Providers; diff --git a/tests/dummy/app/Providers/RouteServiceProvider.php b/tests/dummy/app/Providers/RouteServiceProvider.php index 2b00106..be9fac8 100644 --- a/tests/dummy/app/Providers/RouteServiceProvider.php +++ b/tests/dummy/app/Providers/RouteServiceProvider.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ namespace App\Providers; diff --git a/tests/dummy/config/jsonapi.php b/tests/dummy/config/jsonapi.php index 7d3ea43..b5a4c39 100644 --- a/tests/dummy/config/jsonapi.php +++ b/tests/dummy/config/jsonapi.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ return [ diff --git a/tests/dummy/database/factories/CommentFactory.php b/tests/dummy/database/factories/CommentFactory.php index 148e2a7..e1f5e1c 100644 --- a/tests/dummy/database/factories/CommentFactory.php +++ b/tests/dummy/database/factories/CommentFactory.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/tests/dummy/database/factories/ImageFactory.php b/tests/dummy/database/factories/ImageFactory.php index 3b5fedd..156c6a7 100644 --- a/tests/dummy/database/factories/ImageFactory.php +++ b/tests/dummy/database/factories/ImageFactory.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/tests/dummy/database/factories/PhoneFactory.php b/tests/dummy/database/factories/PhoneFactory.php index 99df93d..cf907d1 100644 --- a/tests/dummy/database/factories/PhoneFactory.php +++ b/tests/dummy/database/factories/PhoneFactory.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/tests/dummy/database/factories/PostFactory.php b/tests/dummy/database/factories/PostFactory.php index 2a51c30..de58440 100644 --- a/tests/dummy/database/factories/PostFactory.php +++ b/tests/dummy/database/factories/PostFactory.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/tests/dummy/database/factories/TagFactory.php b/tests/dummy/database/factories/TagFactory.php index 3a25571..ae92907 100644 --- a/tests/dummy/database/factories/TagFactory.php +++ b/tests/dummy/database/factories/TagFactory.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/tests/dummy/database/factories/UserFactory.php b/tests/dummy/database/factories/UserFactory.php index 70aeb8d..1fef30f 100644 --- a/tests/dummy/database/factories/UserFactory.php +++ b/tests/dummy/database/factories/UserFactory.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/tests/dummy/database/factories/VideoFactory.php b/tests/dummy/database/factories/VideoFactory.php index 8d8ab21..c9c3e60 100644 --- a/tests/dummy/database/factories/VideoFactory.php +++ b/tests/dummy/database/factories/VideoFactory.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/tests/dummy/database/migrations/2020_06_13_143800_create_post_and_video_tables.php b/tests/dummy/database/migrations/2020_06_13_143800_create_post_and_video_tables.php index 687fec1..994a09a 100644 --- a/tests/dummy/database/migrations/2020_06_13_143800_create_post_and_video_tables.php +++ b/tests/dummy/database/migrations/2020_06_13_143800_create_post_and_video_tables.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/tests/dummy/database/migrations/2022_06_25_115000_create_phones_table.php b/tests/dummy/database/migrations/2022_06_25_115000_create_phones_table.php index 39898c9..4e3f00a 100644 --- a/tests/dummy/database/migrations/2022_06_25_115000_create_phones_table.php +++ b/tests/dummy/database/migrations/2022_06_25_115000_create_phones_table.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/tests/dummy/routes/api.php b/tests/dummy/routes/api.php index e81ebbf..a5de0cb 100644 --- a/tests/dummy/routes/api.php +++ b/tests/dummy/routes/api.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ use LaravelJsonApi\Laravel\Facades\JsonApiRoute; diff --git a/tests/dummy/routes/web.php b/tests/dummy/routes/web.php index b71def0..a555fe2 100644 --- a/tests/dummy/routes/web.php +++ b/tests/dummy/routes/web.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ diff --git a/tests/dummy/tests/Api/V1/Posts/Actions/PublishTest.php b/tests/dummy/tests/Api/V1/Posts/Actions/PublishTest.php index 8c517d0..f54b448 100644 --- a/tests/dummy/tests/Api/V1/Posts/Actions/PublishTest.php +++ b/tests/dummy/tests/Api/V1/Posts/Actions/PublishTest.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/tests/dummy/tests/Api/V1/Posts/Actions/PurgeTest.php b/tests/dummy/tests/Api/V1/Posts/Actions/PurgeTest.php index dc22e7c..1417a43 100644 --- a/tests/dummy/tests/Api/V1/Posts/Actions/PurgeTest.php +++ b/tests/dummy/tests/Api/V1/Posts/Actions/PurgeTest.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/tests/dummy/tests/Api/V1/Posts/AttachMediaTest.php b/tests/dummy/tests/Api/V1/Posts/AttachMediaTest.php index 1582f61..d096330 100644 --- a/tests/dummy/tests/Api/V1/Posts/AttachMediaTest.php +++ b/tests/dummy/tests/Api/V1/Posts/AttachMediaTest.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/tests/dummy/tests/Api/V1/Posts/AttachTagsTest.php b/tests/dummy/tests/Api/V1/Posts/AttachTagsTest.php index 2bfd003..33bd26f 100644 --- a/tests/dummy/tests/Api/V1/Posts/AttachTagsTest.php +++ b/tests/dummy/tests/Api/V1/Posts/AttachTagsTest.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/tests/dummy/tests/Api/V1/Posts/CreateTest.php b/tests/dummy/tests/Api/V1/Posts/CreateTest.php index f1c84fd..f76922e 100644 --- a/tests/dummy/tests/Api/V1/Posts/CreateTest.php +++ b/tests/dummy/tests/Api/V1/Posts/CreateTest.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/tests/dummy/tests/Api/V1/Posts/DeleteTest.php b/tests/dummy/tests/Api/V1/Posts/DeleteTest.php index 5973bd4..3154123 100644 --- a/tests/dummy/tests/Api/V1/Posts/DeleteTest.php +++ b/tests/dummy/tests/Api/V1/Posts/DeleteTest.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/tests/dummy/tests/Api/V1/Posts/DetachMediaTest.php b/tests/dummy/tests/Api/V1/Posts/DetachMediaTest.php index b58ae48..9f7e2fa 100644 --- a/tests/dummy/tests/Api/V1/Posts/DetachMediaTest.php +++ b/tests/dummy/tests/Api/V1/Posts/DetachMediaTest.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/tests/dummy/tests/Api/V1/Posts/DetachTagsTest.php b/tests/dummy/tests/Api/V1/Posts/DetachTagsTest.php index 45db616..198d685 100644 --- a/tests/dummy/tests/Api/V1/Posts/DetachTagsTest.php +++ b/tests/dummy/tests/Api/V1/Posts/DetachTagsTest.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/tests/dummy/tests/Api/V1/Posts/IndexTest.php b/tests/dummy/tests/Api/V1/Posts/IndexTest.php index dc8b45f..961c070 100644 --- a/tests/dummy/tests/Api/V1/Posts/IndexTest.php +++ b/tests/dummy/tests/Api/V1/Posts/IndexTest.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/tests/dummy/tests/Api/V1/Posts/ReadAuthorIdentifierTest.php b/tests/dummy/tests/Api/V1/Posts/ReadAuthorIdentifierTest.php index ba1972e..aeed0a1 100644 --- a/tests/dummy/tests/Api/V1/Posts/ReadAuthorIdentifierTest.php +++ b/tests/dummy/tests/Api/V1/Posts/ReadAuthorIdentifierTest.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/tests/dummy/tests/Api/V1/Posts/ReadAuthorTest.php b/tests/dummy/tests/Api/V1/Posts/ReadAuthorTest.php index 9e82e9b..ca54ab2 100644 --- a/tests/dummy/tests/Api/V1/Posts/ReadAuthorTest.php +++ b/tests/dummy/tests/Api/V1/Posts/ReadAuthorTest.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/tests/dummy/tests/Api/V1/Posts/ReadCommentIdentifiersTest.php b/tests/dummy/tests/Api/V1/Posts/ReadCommentIdentifiersTest.php index 4e61c35..21299ca 100644 --- a/tests/dummy/tests/Api/V1/Posts/ReadCommentIdentifiersTest.php +++ b/tests/dummy/tests/Api/V1/Posts/ReadCommentIdentifiersTest.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/tests/dummy/tests/Api/V1/Posts/ReadCommentsTest.php b/tests/dummy/tests/Api/V1/Posts/ReadCommentsTest.php index 037556f..f7357c1 100644 --- a/tests/dummy/tests/Api/V1/Posts/ReadCommentsTest.php +++ b/tests/dummy/tests/Api/V1/Posts/ReadCommentsTest.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/tests/dummy/tests/Api/V1/Posts/ReadMediaTest.php b/tests/dummy/tests/Api/V1/Posts/ReadMediaTest.php index b4c2f6f..d3de278 100644 --- a/tests/dummy/tests/Api/V1/Posts/ReadMediaTest.php +++ b/tests/dummy/tests/Api/V1/Posts/ReadMediaTest.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/tests/dummy/tests/Api/V1/Posts/ReadTagIdentifiersTest.php b/tests/dummy/tests/Api/V1/Posts/ReadTagIdentifiersTest.php index bf4c3f8..9ad6287 100644 --- a/tests/dummy/tests/Api/V1/Posts/ReadTagIdentifiersTest.php +++ b/tests/dummy/tests/Api/V1/Posts/ReadTagIdentifiersTest.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/tests/dummy/tests/Api/V1/Posts/ReadTagsTest.php b/tests/dummy/tests/Api/V1/Posts/ReadTagsTest.php index 4c965f7..fb2bed8 100644 --- a/tests/dummy/tests/Api/V1/Posts/ReadTagsTest.php +++ b/tests/dummy/tests/Api/V1/Posts/ReadTagsTest.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/tests/dummy/tests/Api/V1/Posts/ReadTest.php b/tests/dummy/tests/Api/V1/Posts/ReadTest.php index 827c929..900a4b7 100644 --- a/tests/dummy/tests/Api/V1/Posts/ReadTest.php +++ b/tests/dummy/tests/Api/V1/Posts/ReadTest.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ namespace App\Tests\Api\V1\Posts; diff --git a/tests/dummy/tests/Api/V1/Posts/UpdateMediaTest.php b/tests/dummy/tests/Api/V1/Posts/UpdateMediaTest.php index 91253d5..e4955d0 100644 --- a/tests/dummy/tests/Api/V1/Posts/UpdateMediaTest.php +++ b/tests/dummy/tests/Api/V1/Posts/UpdateMediaTest.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/tests/dummy/tests/Api/V1/Posts/UpdateTagsTest.php b/tests/dummy/tests/Api/V1/Posts/UpdateTagsTest.php index 326c117..3d5cb2f 100644 --- a/tests/dummy/tests/Api/V1/Posts/UpdateTagsTest.php +++ b/tests/dummy/tests/Api/V1/Posts/UpdateTagsTest.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/tests/dummy/tests/Api/V1/Posts/UpdateTest.php b/tests/dummy/tests/Api/V1/Posts/UpdateTest.php index ef6c2f1..2e70dc4 100644 --- a/tests/dummy/tests/Api/V1/Posts/UpdateTest.php +++ b/tests/dummy/tests/Api/V1/Posts/UpdateTest.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/tests/dummy/tests/Api/V1/Serializer.php b/tests/dummy/tests/Api/V1/Serializer.php index 32ca2a9..af31a6e 100644 --- a/tests/dummy/tests/Api/V1/Serializer.php +++ b/tests/dummy/tests/Api/V1/Serializer.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/tests/dummy/tests/Api/V1/TestCase.php b/tests/dummy/tests/Api/V1/TestCase.php index f59cabc..f0f5599 100644 --- a/tests/dummy/tests/Api/V1/TestCase.php +++ b/tests/dummy/tests/Api/V1/TestCase.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/tests/dummy/tests/Api/V1/Users/ReadTest.php b/tests/dummy/tests/Api/V1/Users/ReadTest.php index 5999274..c731a4e 100644 --- a/tests/dummy/tests/Api/V1/Users/ReadTest.php +++ b/tests/dummy/tests/Api/V1/Users/ReadTest.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/tests/dummy/tests/Api/V1/Users/UpdatePhoneTest.php b/tests/dummy/tests/Api/V1/Users/UpdatePhoneTest.php index 5b0bd88..fa7bf5d 100644 --- a/tests/dummy/tests/Api/V1/Users/UpdatePhoneTest.php +++ b/tests/dummy/tests/Api/V1/Users/UpdatePhoneTest.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/tests/dummy/tests/Api/V1/Videos/CreateTest.php b/tests/dummy/tests/Api/V1/Videos/CreateTest.php index 777c414..b19a6cb 100644 --- a/tests/dummy/tests/Api/V1/Videos/CreateTest.php +++ b/tests/dummy/tests/Api/V1/Videos/CreateTest.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/tests/dummy/tests/TestCase.php b/tests/dummy/tests/TestCase.php index 08f34de..5002c30 100644 --- a/tests/dummy/tests/TestCase.php +++ b/tests/dummy/tests/TestCase.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/tests/lib/Acceptance/DefaultIncludePaths/Test.php b/tests/lib/Acceptance/DefaultIncludePaths/Test.php index 385d374..22ba719 100644 --- a/tests/lib/Acceptance/DefaultIncludePaths/Test.php +++ b/tests/lib/Acceptance/DefaultIncludePaths/Test.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/tests/lib/Acceptance/DefaultIncludePaths/TestRequest.php b/tests/lib/Acceptance/DefaultIncludePaths/TestRequest.php index a09d62a..41114d8 100644 --- a/tests/lib/Acceptance/DefaultIncludePaths/TestRequest.php +++ b/tests/lib/Acceptance/DefaultIncludePaths/TestRequest.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/tests/lib/Acceptance/Relationships/ToManyLinksTest.php b/tests/lib/Acceptance/Relationships/ToManyLinksTest.php index 7e78a26..c6391f9 100644 --- a/tests/lib/Acceptance/Relationships/ToManyLinksTest.php +++ b/tests/lib/Acceptance/Relationships/ToManyLinksTest.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/tests/lib/Acceptance/Relationships/ToOneLinksTest.php b/tests/lib/Acceptance/Relationships/ToOneLinksTest.php index 4373dc4..65484d3 100644 --- a/tests/lib/Acceptance/Relationships/ToOneLinksTest.php +++ b/tests/lib/Acceptance/Relationships/ToOneLinksTest.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/tests/lib/Acceptance/RequestBodyContentTest.php b/tests/lib/Acceptance/RequestBodyContentTest.php index c68b8ad..d493ffe 100644 --- a/tests/lib/Acceptance/RequestBodyContentTest.php +++ b/tests/lib/Acceptance/RequestBodyContentTest.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/tests/lib/Acceptance/ResponseTest.php b/tests/lib/Acceptance/ResponseTest.php index 565e5dd..69a0b66 100644 --- a/tests/lib/Acceptance/ResponseTest.php +++ b/tests/lib/Acceptance/ResponseTest.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/tests/lib/Acceptance/TestCase.php b/tests/lib/Acceptance/TestCase.php index 3309947..8802302 100644 --- a/tests/lib/Acceptance/TestCase.php +++ b/tests/lib/Acceptance/TestCase.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/tests/lib/Integration/Console/MakeAuthorizerTest.php b/tests/lib/Integration/Console/MakeAuthorizerTest.php index c574ca3..a16b44b 100644 --- a/tests/lib/Integration/Console/MakeAuthorizerTest.php +++ b/tests/lib/Integration/Console/MakeAuthorizerTest.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/tests/lib/Integration/Console/MakeControllerTest.php b/tests/lib/Integration/Console/MakeControllerTest.php index a905ce6..ad6745c 100644 --- a/tests/lib/Integration/Console/MakeControllerTest.php +++ b/tests/lib/Integration/Console/MakeControllerTest.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/tests/lib/Integration/Console/MakeFilterTest.php b/tests/lib/Integration/Console/MakeFilterTest.php index 6ca9a7b..5f61505 100644 --- a/tests/lib/Integration/Console/MakeFilterTest.php +++ b/tests/lib/Integration/Console/MakeFilterTest.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/tests/lib/Integration/Console/MakeQueryTest.php b/tests/lib/Integration/Console/MakeQueryTest.php index afb1fda..3a95bd0 100644 --- a/tests/lib/Integration/Console/MakeQueryTest.php +++ b/tests/lib/Integration/Console/MakeQueryTest.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/tests/lib/Integration/Console/MakeRequestTest.php b/tests/lib/Integration/Console/MakeRequestTest.php index 1fb3fe2..fd8a8fa 100644 --- a/tests/lib/Integration/Console/MakeRequestTest.php +++ b/tests/lib/Integration/Console/MakeRequestTest.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/tests/lib/Integration/Console/MakeRequestsTest.php b/tests/lib/Integration/Console/MakeRequestsTest.php index 0008ead..3703ec6 100644 --- a/tests/lib/Integration/Console/MakeRequestsTest.php +++ b/tests/lib/Integration/Console/MakeRequestsTest.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/tests/lib/Integration/Console/MakeResourceTest.php b/tests/lib/Integration/Console/MakeResourceTest.php index 0abc975..b28596f 100644 --- a/tests/lib/Integration/Console/MakeResourceTest.php +++ b/tests/lib/Integration/Console/MakeResourceTest.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/tests/lib/Integration/Console/MakeSchemaTest.php b/tests/lib/Integration/Console/MakeSchemaTest.php index 2bed5c4..7d99697 100644 --- a/tests/lib/Integration/Console/MakeSchemaTest.php +++ b/tests/lib/Integration/Console/MakeSchemaTest.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/tests/lib/Integration/Console/MakeServerTest.php b/tests/lib/Integration/Console/MakeServerTest.php index 6085ce3..16cf284 100644 --- a/tests/lib/Integration/Console/MakeServerTest.php +++ b/tests/lib/Integration/Console/MakeServerTest.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/tests/lib/Integration/Console/MakeSortFieldTest.php b/tests/lib/Integration/Console/MakeSortFieldTest.php index 9497945..59d8d8e 100644 --- a/tests/lib/Integration/Console/MakeSortFieldTest.php +++ b/tests/lib/Integration/Console/MakeSortFieldTest.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/tests/lib/Integration/Console/StubPublishTest.php b/tests/lib/Integration/Console/StubPublishTest.php index 9e54680..519b204 100644 --- a/tests/lib/Integration/Console/StubPublishTest.php +++ b/tests/lib/Integration/Console/StubPublishTest.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/tests/lib/Integration/Routing/ActionsTest.php b/tests/lib/Integration/Routing/ActionsTest.php index 51460d4..4a3c9b6 100644 --- a/tests/lib/Integration/Routing/ActionsTest.php +++ b/tests/lib/Integration/Routing/ActionsTest.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/tests/lib/Integration/Routing/HasManyTest.php b/tests/lib/Integration/Routing/HasManyTest.php index 781c3cb..56e1a1b 100644 --- a/tests/lib/Integration/Routing/HasManyTest.php +++ b/tests/lib/Integration/Routing/HasManyTest.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/tests/lib/Integration/Routing/HasOneTest.php b/tests/lib/Integration/Routing/HasOneTest.php index 8ea35e6..a2d8e23 100644 --- a/tests/lib/Integration/Routing/HasOneTest.php +++ b/tests/lib/Integration/Routing/HasOneTest.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/tests/lib/Integration/Routing/ResourceTest.php b/tests/lib/Integration/Routing/ResourceTest.php index 5287a65..bb3c152 100644 --- a/tests/lib/Integration/Routing/ResourceTest.php +++ b/tests/lib/Integration/Routing/ResourceTest.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/tests/lib/Integration/Routing/TestCase.php b/tests/lib/Integration/Routing/TestCase.php index 9c20670..e520ec1 100644 --- a/tests/lib/Integration/Routing/TestCase.php +++ b/tests/lib/Integration/Routing/TestCase.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/tests/lib/Integration/TestCase.php b/tests/lib/Integration/TestCase.php index 298f7ee..cee8398 100644 --- a/tests/lib/Integration/TestCase.php +++ b/tests/lib/Integration/TestCase.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); diff --git a/tests/lib/Unit/PackageTest.php b/tests/lib/Unit/PackageTest.php index fc921d0..8bd5803 100644 --- a/tests/lib/Unit/PackageTest.php +++ b/tests/lib/Unit/PackageTest.php @@ -2,17 +2,9 @@ /* * Copyright 2024 Cloud Creativity Limited * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. */ declare(strict_types=1); From 12e702cbbda35551c27791318ff30bba82c10df6 Mon Sep 17 00:00:00 2001 From: Christopher Gammie Date: Thu, 14 Mar 2024 18:09:19 +0000 Subject: [PATCH 10/28] docs: update changelog and bump version --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0637f8b..5dd13a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ All notable changes to this project will be documented in this file. This projec ## Unreleased +## [4.0.0] - 2024-03-14 + ### Changed - Package is now licensed under the MIT License. From e7559db6a78e226ce83ce4c39f6a7ad4391ab8f0 Mon Sep 17 00:00:00 2001 From: Christopher Gammie Date: Wed, 26 Jun 2024 20:34:12 +0100 Subject: [PATCH 11/28] fix: ensure self link is correct in related resource responses --- CHANGELOG.md | 6 ++ composer.json | 2 +- .../tests/Api/V1/Posts/ReadAuthorTest.php | 9 ++- .../tests/Api/V1/Posts/ReadCommentsTest.php | 9 +-- .../dummy/tests/Api/V1/Posts/ReadTagsTest.php | 9 +-- .../Relationships/ToManyLinksTest.php | 61 ++++++++++++++++--- .../Relationships/ToOneLinksTest.php | 59 +++++++++++++++--- 7 files changed, 120 insertions(+), 35 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5dd13a4..9684c08 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. This projec ## Unreleased +### Fixed + +- [core#17](https://github.com/laravel-json-api/core/pull/17) Fix incorrect `self` link in related resource responses, + and remove `related` link that should not exist. This has been incorrect for some time, but is definitely what + the [spec defines here.](https://jsonapi.org/format/1.0/#document-top-level) + ## [4.0.0] - 2024-03-14 ### Changed diff --git a/composer.json b/composer.json index a09de20..3eba78d 100644 --- a/composer.json +++ b/composer.json @@ -25,7 +25,7 @@ "require": { "php": "^8.2", "ext-json": "*", - "laravel-json-api/core": "^4.0", + "laravel-json-api/core": "^4.1", "laravel-json-api/eloquent": "^4.0", "laravel-json-api/encoder-neomerx": "^4.0", "laravel-json-api/exceptions": "^3.0", diff --git a/tests/dummy/tests/Api/V1/Posts/ReadAuthorTest.php b/tests/dummy/tests/Api/V1/Posts/ReadAuthorTest.php index ca54ab2..c8906e4 100644 --- a/tests/dummy/tests/Api/V1/Posts/ReadAuthorTest.php +++ b/tests/dummy/tests/Api/V1/Posts/ReadAuthorTest.php @@ -42,12 +42,11 @@ public function test(): void $response = $this ->withoutExceptionHandling() ->jsonApi('users') - ->get($related = url('/api/v1/posts', [$this->post, 'author'])); + ->get($self = url('/api/v1/posts', [$this->post, 'author'])); - $response->assertFetchedOneExact($expected)->assertLinks([ - 'self' => url('/api/v1/posts', [$this->post, 'relationships', 'author']), - 'related' => $related, - ]); + $response + ->assertFetchedOneExact($expected) + ->assertLinks(['self' => $self]); } public function testFilterMatches(): void diff --git a/tests/dummy/tests/Api/V1/Posts/ReadCommentsTest.php b/tests/dummy/tests/Api/V1/Posts/ReadCommentsTest.php index f7357c1..c80f0a3 100644 --- a/tests/dummy/tests/Api/V1/Posts/ReadCommentsTest.php +++ b/tests/dummy/tests/Api/V1/Posts/ReadCommentsTest.php @@ -48,15 +48,10 @@ public function test(): void $response = $this ->withoutExceptionHandling() ->jsonApi('comments') - ->get($related = url('/api/v1/posts', [$this->post, 'comments'])); - - $links = [ - 'self' => url('/api/v1/posts', [$this->post, 'relationships', 'comments']), - 'related' => $related, - ]; + ->get($self = url('/api/v1/posts', [$this->post, 'comments'])); $response->assertFetchedMany($expected) - ->assertLinks($links) + ->assertLinks(['self' => $self]) ->assertExactMeta(['count' => 3]); } diff --git a/tests/dummy/tests/Api/V1/Posts/ReadTagsTest.php b/tests/dummy/tests/Api/V1/Posts/ReadTagsTest.php index fb2bed8..f83319e 100644 --- a/tests/dummy/tests/Api/V1/Posts/ReadTagsTest.php +++ b/tests/dummy/tests/Api/V1/Posts/ReadTagsTest.php @@ -43,11 +43,12 @@ public function test(): void $response = $this ->jsonApi('tags') - ->get(url('/api/v1/posts', [$this->post, 'tags'])); + ->get($self = url('/api/v1/posts', [$this->post, 'tags'])); - $response->assertFetchedMany($expected)->assertExactMeta([ - 'count' => count($expected) - ]); + $response + ->assertFetchedMany($expected) + ->assertExactMeta(['count' => count($expected)]) + ->assertLinks(['self' => $self]); } public function testSort(): void diff --git a/tests/lib/Acceptance/Relationships/ToManyLinksTest.php b/tests/lib/Acceptance/Relationships/ToManyLinksTest.php index c6391f9..1fc5169 100644 --- a/tests/lib/Acceptance/Relationships/ToManyLinksTest.php +++ b/tests/lib/Acceptance/Relationships/ToManyLinksTest.php @@ -15,6 +15,7 @@ use App\Models\Post; use App\Models\Tag; use Closure; +use LaravelJsonApi\Core\Document\Links; use LaravelJsonApi\Core\Facades\JsonApi; use LaravelJsonApi\Laravel\Facades\JsonApiRoute; use LaravelJsonApi\Laravel\Http\Controllers\JsonApiController; @@ -60,7 +61,7 @@ protected function setUp(): void /** * @return array[] */ - public static function scenarioProvider(): array + public static function relationshipProvider(): array { return [ 'hidden' => [ @@ -99,39 +100,81 @@ static function (PostSchema $schema, Post $post) { /** * @param Closure $scenario * @return void - * @dataProvider scenarioProvider + * @dataProvider relationshipProvider */ - public function testRelated(Closure $scenario): void + public function testRelationship(Closure $scenario): void { $expected = $scenario($this->schema, $this->post); $response = $this ->withoutExceptionHandling() ->jsonApi('tags') - ->get(url('/api/v1/posts', [$this->post, 'tags'])); + ->get(url('/api/v1/posts', [$this->post, 'relationships', 'tags'])); - $response->assertFetchedMany([$this->tag]); + $response->assertFetchedToMany([$this->tag]); if (is_array($expected)) { $response->assertLinks($expected); } } + + /** + * @return array[] + */ + public static function relatedProvider(): array + { + return [ + 'hidden' => [ + static function (PostSchema $schema) { + $schema->relationship('tags')->hidden(); + return null; + }, + ], + 'no links' => [ + static function (PostSchema $schema) { + $schema->relationship('tags')->serializeUsing( + static fn($relation) => $relation->withoutLinks() + ); + return null; + }, + ], + 'no self link' => [ + static function (PostSchema $schema, Post $post) { + $schema->relationship('tags')->serializeUsing( + static fn($relation) => $relation->withoutSelfLink() + ); + // related becomes self. + return ['self' => url('/api/v1/posts', [$post, 'tags'])]; + }, + ], + 'no related link' => [ + static function (PostSchema $schema, Post $post) { + $schema->relationship('tags')->serializeUsing( + static fn($relation) => $relation->withoutRelatedLink() + ); + // related becomes self, but it's missing so we can't do that. + return null; + }, + ], + ]; + } + /** * @param Closure $scenario * @return void - * @dataProvider scenarioProvider + * @dataProvider relatedProvider */ - public function testSelf(Closure $scenario): void + public function testRelated(Closure $scenario): void { $expected = $scenario($this->schema, $this->post); $response = $this ->withoutExceptionHandling() ->jsonApi('tags') - ->get(url('/api/v1/posts', [$this->post, 'relationships', 'tags'])); + ->get(url('/api/v1/posts', [$this->post, 'tags'])); - $response->assertFetchedToMany([$this->tag]); + $response->assertFetchedMany([$this->tag]); if (is_array($expected)) { $response->assertLinks($expected); diff --git a/tests/lib/Acceptance/Relationships/ToOneLinksTest.php b/tests/lib/Acceptance/Relationships/ToOneLinksTest.php index 65484d3..a931654 100644 --- a/tests/lib/Acceptance/Relationships/ToOneLinksTest.php +++ b/tests/lib/Acceptance/Relationships/ToOneLinksTest.php @@ -53,7 +53,7 @@ protected function setUp(): void /** * @return array[] */ - public static function scenarioProvider(): array + public static function relationshipProvider(): array { return [ 'hidden' => [ @@ -92,39 +92,80 @@ static function (PostSchema $schema, Post $post) { /** * @param Closure $scenario * @return void - * @dataProvider scenarioProvider + * @dataProvider relationshipProvider */ - public function testRelated(Closure $scenario): void + public function testRelationship(Closure $scenario): void { $expected = $scenario($this->schema, $this->post); $response = $this ->withoutExceptionHandling() ->jsonApi('users') - ->get(url('/api/v1/posts', [$this->post, 'author'])); + ->get(url('/api/v1/posts', [$this->post, 'relationships', 'author'])); - $response->assertFetchedOne($this->post->author); + $response->assertFetchedToOne($this->post->author); if (is_array($expected)) { $response->assertLinks($expected); } } + /** + * @return array[] + */ + public static function relatedProvider(): array + { + return [ + 'hidden' => [ + static function (PostSchema $schema) { + $schema->relationship('author')->hidden(); + return null; + }, + ], + 'no links' => [ + static function (PostSchema $schema) { + $schema->relationship('author')->serializeUsing( + static fn($relation) => $relation->withoutLinks() + ); + return null; + }, + ], + 'no self link' => [ + static function (PostSchema $schema, Post $post) { + $schema->relationship('author')->serializeUsing( + static fn($relation) => $relation->withoutSelfLink() + ); + // related becomes self + return ['self' => url('/api/v1/posts', [$post, 'author'])]; + }, + ], + 'no related link' => [ + static function (PostSchema $schema, Post $post) { + $schema->relationship('author')->serializeUsing( + static fn($relation) => $relation->withoutRelatedLink() + ); + // related becomes self but it's missing + return null; + }, + ], + ]; + } + /** * @param Closure $scenario * @return void - * @dataProvider scenarioProvider + * @dataProvider relatedProvider */ - public function testSelf(Closure $scenario): void + public function testRelated(Closure $scenario): void { $expected = $scenario($this->schema, $this->post); $response = $this ->withoutExceptionHandling() ->jsonApi('users') - ->get(url('/api/v1/posts', [$this->post, 'relationships', 'author'])); + ->get(url('/api/v1/posts', [$this->post, 'author'])); - $response->assertFetchedToOne($this->post->author); + $response->assertFetchedOne($this->post->author); if (is_array($expected)) { $response->assertLinks($expected); From e2b76002613a7dc84d595e190b9eb18a51ee8f9e Mon Sep 17 00:00:00 2001 From: Christopher Gammie Date: Wed, 26 Jun 2024 20:36:10 +0100 Subject: [PATCH 12/28] feat: support Eloquent dynamic relationships --- CHANGELOG.md | 1 + composer.json | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9684c08..df35b11 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ All notable changes to this project will be documented in this file. This projec - [core#17](https://github.com/laravel-json-api/core/pull/17) Fix incorrect `self` link in related resource responses, and remove `related` link that should not exist. This has been incorrect for some time, but is definitely what the [spec defines here.](https://jsonapi.org/format/1.0/#document-top-level) +- [eloquent#36](https://github.com/laravel-json-api/eloquent/pull/36) Support Eloquent dynamic relationships. ## [4.0.0] - 2024-03-14 diff --git a/composer.json b/composer.json index 3eba78d..9fb3e7a 100644 --- a/composer.json +++ b/composer.json @@ -26,7 +26,7 @@ "php": "^8.2", "ext-json": "*", "laravel-json-api/core": "^4.1", - "laravel-json-api/eloquent": "^4.0", + "laravel-json-api/eloquent": "^4.1", "laravel-json-api/encoder-neomerx": "^4.0", "laravel-json-api/exceptions": "^3.0", "laravel-json-api/spec": "^3.0", From b2e1012fc097096a293a874aba301ca7ab43ea5c Mon Sep 17 00:00:00 2001 From: Christopher Gammie Date: Wed, 26 Jun 2024 20:46:50 +0100 Subject: [PATCH 13/28] docs: update changelog and bump version --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index df35b11..ac5a964 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ All notable changes to this project will be documented in this file. This projec ## Unreleased +## [4.1.0] - 2024-06-26 + ### Fixed - [core#17](https://github.com/laravel-json-api/core/pull/17) Fix incorrect `self` link in related resource responses, From 2f0c672d336832f032b276578b44fc8f4888dd77 Mon Sep 17 00:00:00 2001 From: SerhiiKotelnikov <165281614+SerhiiKotelnikov@users.noreply.github.com> Date: Tue, 5 Nov 2024 15:32:52 +0200 Subject: [PATCH 14/28] docs: update readme link to docs (#297) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 50ef5fa..977e3d9 100644 --- a/README.md +++ b/README.md @@ -97,7 +97,7 @@ See our website, [laraveljsonapi.io](https://laraveljsonapi.io) ### Tutorial New to JSON:API and/or Laravel JSON:API? Then -the [Laravel JSON:API tutorial](https://laraveljsonapi.io/docs/2.0/tutorial/) +the [Laravel JSON:API tutorial](https://laraveljsonapi.io/4.x/tutorial/) is a great way to learn! Follow the tutorial to build a blog application with a JSON:API compliant API. From 0f10886a27d7d71a1240c7f7dc182c1bb3c3abbe Mon Sep 17 00:00:00 2001 From: Christopher Gammie Date: Fri, 29 Nov 2024 18:32:02 +0000 Subject: [PATCH 15/28] fix: remove deprecation notices in php 8.4 --- .github/workflows/tests.yml | 2 +- CHANGELOG.md | 4 ++++ composer.json | 14 ++++++------- phpunit.xml | 21 ++++++++++++++----- src/Exceptions/HttpNotAcceptableException.php | 4 ++-- src/Routing/ActionRegistrar.php | 16 +++++++------- src/Routing/PendingResourceRegistration.php | 2 +- src/Routing/ResourceRegistrar.php | 2 +- tests/lib/Integration/Routing/TestCase.php | 6 +++--- 9 files changed, 43 insertions(+), 28 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 843531a..1f1b5a4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -14,7 +14,7 @@ jobs: strategy: fail-fast: true matrix: - php: [8.2, 8.3] + php: [8.2, 8.3, 8.4] laravel: [11] steps: diff --git a/CHANGELOG.md b/CHANGELOG.md index ac5a964..c713820 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file. This projec ## Unreleased +### Fixed + +- Remove deprecation notices in PHP 8.4. + ## [4.1.0] - 2024-06-26 ### Fixed diff --git a/composer.json b/composer.json index 9fb3e7a..5ac9733 100644 --- a/composer.json +++ b/composer.json @@ -25,16 +25,16 @@ "require": { "php": "^8.2", "ext-json": "*", - "laravel-json-api/core": "^4.1", - "laravel-json-api/eloquent": "^4.1", - "laravel-json-api/encoder-neomerx": "^4.0", - "laravel-json-api/exceptions": "^3.0", - "laravel-json-api/spec": "^3.0", - "laravel-json-api/validation": "^4.0", + "laravel-json-api/core": "^4.3.2", + "laravel-json-api/eloquent": "^4.4", + "laravel-json-api/encoder-neomerx": "^4.1", + "laravel-json-api/exceptions": "^3.1", + "laravel-json-api/spec": "^3.1", + "laravel-json-api/validation": "^4.2", "laravel/framework": "^11.0" }, "require-dev": { - "laravel-json-api/testing": "^3.0", + "laravel-json-api/testing": "^3.0.2", "orchestra/testbench": "^9.0", "phpunit/phpunit": "^10.5" }, diff --git a/phpunit.xml b/phpunit.xml index 539875b..f2ba358 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,9 +1,20 @@ - + diff --git a/src/Exceptions/HttpNotAcceptableException.php b/src/Exceptions/HttpNotAcceptableException.php index ea6384d..7f7594a 100644 --- a/src/Exceptions/HttpNotAcceptableException.php +++ b/src/Exceptions/HttpNotAcceptableException.php @@ -26,8 +26,8 @@ class HttpNotAcceptableException extends HttpException * @param int $code */ public function __construct( - string $message = null, - Throwable $previous = null, + ?string $message = null, + ?Throwable $previous = null, array $headers = [], int $code = 0 ) { diff --git a/src/Routing/ActionRegistrar.php b/src/Routing/ActionRegistrar.php index c259278..b98680f 100644 --- a/src/Routing/ActionRegistrar.php +++ b/src/Routing/ActionRegistrar.php @@ -77,7 +77,7 @@ public function __construct( string $resourceType, array $options, string $controller, - string $prefix = null + ?string $prefix = null ) { $this->router = $router; $this->resource = $resource; @@ -106,7 +106,7 @@ public function withId(): self * @param string|null $method * @return ActionProxy */ - public function get(string $uri, string $method = null): ActionProxy + public function get(string $uri, ?string $method = null): ActionProxy { return $this->register('get', $uri, $method); } @@ -118,7 +118,7 @@ public function get(string $uri, string $method = null): ActionProxy * @param string|null $method * @return ActionProxy */ - public function post(string $uri, string $method = null): ActionProxy + public function post(string $uri, ?string $method = null): ActionProxy { return $this->register('post', $uri, $method); } @@ -130,7 +130,7 @@ public function post(string $uri, string $method = null): ActionProxy * @param string|null $method * @return ActionProxy */ - public function patch(string $uri, string $method = null): ActionProxy + public function patch(string $uri, ?string $method = null): ActionProxy { return $this->register('patch', $uri, $method); } @@ -142,7 +142,7 @@ public function patch(string $uri, string $method = null): ActionProxy * @param string|null $method * @return ActionProxy */ - public function put(string $uri, string $method = null): ActionProxy + public function put(string $uri, ?string $method = null): ActionProxy { return $this->register('put', $uri, $method); } @@ -154,7 +154,7 @@ public function put(string $uri, string $method = null): ActionProxy * @param string|null $method * @return ActionProxy */ - public function delete(string $uri, string $method = null): ActionProxy + public function delete(string $uri, ?string $method = null): ActionProxy { return $this->register('delete', $uri, $method); } @@ -166,7 +166,7 @@ public function delete(string $uri, string $method = null): ActionProxy * @param string|null $method * @return ActionProxy */ - public function options(string $uri, string $method = null): ActionProxy + public function options(string $uri, ?string $method = null): ActionProxy { return $this->register('options', $uri, $method); } @@ -177,7 +177,7 @@ public function options(string $uri, string $method = null): ActionProxy * @param string|null $action * @return ActionProxy */ - public function register(string $method, string $uri, string $action = null): ActionProxy + public function register(string $method, string $uri, ?string $action = null): ActionProxy { $action = $action ?: $this->guessControllerAction($uri); $parameter = $this->getParameter(); diff --git a/src/Routing/PendingResourceRegistration.php b/src/Routing/PendingResourceRegistration.php index c98fa02..627bd0f 100644 --- a/src/Routing/PendingResourceRegistration.php +++ b/src/Routing/PendingResourceRegistration.php @@ -229,7 +229,7 @@ public function relationships(Closure $callback): self * @param Closure|null $callback * @return $this */ - public function actions($prefixOrCallback, Closure $callback = null): self + public function actions($prefixOrCallback, ?Closure $callback = null): self { if ($prefixOrCallback instanceof Closure && null === $callback) { $this->actionsPrefix = null; diff --git a/src/Routing/ResourceRegistrar.php b/src/Routing/ResourceRegistrar.php index 265fc79..5da31db 100644 --- a/src/Routing/ResourceRegistrar.php +++ b/src/Routing/ResourceRegistrar.php @@ -51,7 +51,7 @@ public function __construct(RegistrarContract $router, Server $server) * @param string|null $controller * @return PendingResourceRegistration */ - public function resource(string $resourceType, string $controller = null): PendingResourceRegistration + public function resource(string $resourceType, ?string $controller = null): PendingResourceRegistration { return new PendingResourceRegistration( $this, diff --git a/tests/lib/Integration/Routing/TestCase.php b/tests/lib/Integration/Routing/TestCase.php index e520ec1..d8d589f 100644 --- a/tests/lib/Integration/Routing/TestCase.php +++ b/tests/lib/Integration/Routing/TestCase.php @@ -66,8 +66,8 @@ protected function createServer(string $name): Server protected function createSchema( Server $server, string $name, - string $pattern = null, - string $uriType = null + ?string $pattern = null, + ?string $uriType = null ): Schema { $schema = $this->createMock(Schema::class); @@ -89,7 +89,7 @@ protected function createSchema( * @param string|null $uriName * @return void */ - protected function createRelation(MockObject $schema, string $fieldName, string $uriName = null): void + protected function createRelation(MockObject $schema, string $fieldName, ?string $uriName = null): void { $relation = $this->createMock(Relation::class); $relation->method('name')->willReturn($fieldName); From fa0addc1b47fff14d02259c38f4b52824d7d392d Mon Sep 17 00:00:00 2001 From: Christopher Gammie Date: Sat, 30 Nov 2024 17:58:48 +0000 Subject: [PATCH 16/28] docs: update changelog and bump version --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c713820..f404766 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ All notable changes to this project will be documented in this file. This projec ## Unreleased +## [4.1.1] - 2024-11-30 + ### Fixed - Remove deprecation notices in PHP 8.4. From e8d4e193b0c3f160976ee29fc8305675def8c134 Mon Sep 17 00:00:00 2001 From: Gregory Haddow Date: Fri, 22 Nov 2024 10:58:23 +0000 Subject: [PATCH 17/28] feat: support auth responses from authorizer contract --- composer.json | 2 +- src/Http/Requests/FormRequest.php | 62 ++++++++++++------- src/Http/Requests/ResourceQuery.php | 5 +- src/Http/Requests/ResourceRequest.php | 5 +- .../Controllers/Api/V1/UserController.php | 1 + tests/dummy/app/Policies/UserPolicy.php | 14 +++++ tests/dummy/routes/api.php | 2 +- tests/dummy/tests/Api/V1/Users/DeleteTest.php | 38 ++++++++++++ 8 files changed, 99 insertions(+), 30 deletions(-) create mode 100644 tests/dummy/tests/Api/V1/Users/DeleteTest.php diff --git a/composer.json b/composer.json index 5ac9733..7516ea9 100644 --- a/composer.json +++ b/composer.json @@ -25,7 +25,7 @@ "require": { "php": "^8.2", "ext-json": "*", - "laravel-json-api/core": "^4.3.2", + "laravel-json-api/core": "^4.3.2|^5.0.1", "laravel-json-api/eloquent": "^4.4", "laravel-json-api/encoder-neomerx": "^4.1", "laravel-json-api/exceptions": "^3.1", diff --git a/src/Http/Requests/FormRequest.php b/src/Http/Requests/FormRequest.php index 1ff4f8e..a4974ca 100644 --- a/src/Http/Requests/FormRequest.php +++ b/src/Http/Requests/FormRequest.php @@ -11,6 +11,8 @@ namespace LaravelJsonApi\Laravel\Http\Requests; +use Illuminate\Auth\Access\AuthorizationException; +use Illuminate\Auth\Access\Response; use Illuminate\Auth\AuthenticationException; use Illuminate\Contracts\Auth\Guard; use Illuminate\Foundation\Http\FormRequest as BaseFormRequest; @@ -226,42 +228,54 @@ public function schema(): Schema */ protected function passesAuthorization() { - /** - * If the developer has implemented the `authorize` method, we - * will return the result if it is a boolean. This allows - * the developer to return a null value to indicate they want - * the default authorization to run. - */ - if (method_exists($this, 'authorize')) { - if (is_bool($passes = $this->container->call([$this, 'authorize']))) { - return $passes; + try { + /** + * If the developer has implemented the `authorize` method, we + * will return the result if it is a boolean. This allows + * the developer to return a null value to indicate they want + * the default authorization to run. + */ + if (method_exists($this, 'authorize')) { + $result = $this->container->call([$this, 'authorize']); + if ($result !== null) { + return $result instanceof Response ? $result->authorize() : $result; + } } - } - /** - * If the developer has not authorized the request themselves, - * we run our default authorization as long as authorization is - * enabled for both the server and the schema (checked via the - * `mustAuthorize()` method). - */ - if (method_exists($this, 'authorizeResource')) { - return $this->container->call([$this, 'authorizeResource']); - } + /** + * If the developer has not authorized the request themselves, + * we run our default authorization as long as authorization is + * enabled for both the server and the schema (checked via the + * `mustAuthorize()` method). + */ + if (method_exists($this, 'authorizeResource')) { + $result = $this->container->call([$this, 'authorizeResource']); + return $result instanceof Response ? $result->authorize() : $result; + } + } catch (AuthorizationException $ex) { + $this->failIfUnauthenticated(); + throw $ex; + } return true; } - /** - * @inheritDoc - */ - protected function failedAuthorization() + protected function failIfUnauthenticated() { - /** @var Guard $auth */ + /** @var Guard $auth */ $auth = $this->container->make(Guard::class); if ($auth->guest()) { throw new AuthenticationException(); } + } + + /** + * @inheritDoc + */ + protected function failedAuthorization() + { + $this->failIfUnauthenticated(); parent::failedAuthorization(); } diff --git a/src/Http/Requests/ResourceQuery.php b/src/Http/Requests/ResourceQuery.php index 116d5b9..940fc6e 100644 --- a/src/Http/Requests/ResourceQuery.php +++ b/src/Http/Requests/ResourceQuery.php @@ -11,6 +11,7 @@ namespace LaravelJsonApi\Laravel\Http\Requests; +use Illuminate\Auth\Access\Response; use Illuminate\Contracts\Validation\Validator; use Illuminate\Database\Eloquent\Model; use LaravelJsonApi\Contracts\Auth\Authorizer; @@ -104,9 +105,9 @@ public static function queryOne(string $resourceType): QueryParameters * Perform resource authorization. * * @param Authorizer $authorizer - * @return bool + * @return bool|Response */ - public function authorizeResource(Authorizer $authorizer): bool + public function authorizeResource(Authorizer $authorizer): bool|Response { if ($this->isViewingAny()) { return $authorizer->index( diff --git a/src/Http/Requests/ResourceRequest.php b/src/Http/Requests/ResourceRequest.php index 7a0a267..7b0ef36 100644 --- a/src/Http/Requests/ResourceRequest.php +++ b/src/Http/Requests/ResourceRequest.php @@ -11,6 +11,7 @@ namespace LaravelJsonApi\Laravel\Http\Requests; +use Illuminate\Auth\Access\Response; use Illuminate\Contracts\Validation\Factory as ValidationFactory; use Illuminate\Contracts\Validation\Validator; use Illuminate\Database\Eloquent\Model; @@ -150,9 +151,9 @@ public function toMany(): Collection * Perform resource authorization. * * @param Authorizer $authorizer - * @return bool + * @return bool|Response */ - public function authorizeResource(Authorizer $authorizer): bool + public function authorizeResource(Authorizer $authorizer): bool|Response { if ($this->isCreating()) { return $authorizer->store( diff --git a/tests/dummy/app/Http/Controllers/Api/V1/UserController.php b/tests/dummy/app/Http/Controllers/Api/V1/UserController.php index 0975510..131460c 100644 --- a/tests/dummy/app/Http/Controllers/Api/V1/UserController.php +++ b/tests/dummy/app/Http/Controllers/Api/V1/UserController.php @@ -19,6 +19,7 @@ class UserController extends Controller { use Actions\FetchOne; + use Actions\Destroy; use Actions\FetchRelated; use Actions\FetchRelationship; use Actions\UpdateRelationship; diff --git a/tests/dummy/app/Policies/UserPolicy.php b/tests/dummy/app/Policies/UserPolicy.php index 6c3e233..6fc202c 100644 --- a/tests/dummy/app/Policies/UserPolicy.php +++ b/tests/dummy/app/Policies/UserPolicy.php @@ -12,6 +12,7 @@ namespace App\Policies; use App\Models\User; +use Illuminate\Auth\Access\Response; class UserPolicy { @@ -50,4 +51,17 @@ public function updatePhone(User $user, User $other): bool { return $user->is($other); } + + /** + * Determine if the user can delete the other user. + * + * @param User $user + * @param User $other + * @return bool|Response + */ + public function delete(User $user, User $other) + { + return $user->is($other) ? true : Response::denyAsNotFound('not found message'); + } + } diff --git a/tests/dummy/routes/api.php b/tests/dummy/routes/api.php index a5de0cb..482a64d 100644 --- a/tests/dummy/routes/api.php +++ b/tests/dummy/routes/api.php @@ -25,7 +25,7 @@ }); /** Users */ - $server->resource('users')->only('show')->relationships(function ($relationships) { + $server->resource('users')->only('show','destroy')->relationships(function ($relationships) { $relationships->hasOne('phone'); })->actions(function ($actions) { $actions->get('me'); diff --git a/tests/dummy/tests/Api/V1/Users/DeleteTest.php b/tests/dummy/tests/Api/V1/Users/DeleteTest.php new file mode 100644 index 0000000..4980767 --- /dev/null +++ b/tests/dummy/tests/Api/V1/Users/DeleteTest.php @@ -0,0 +1,38 @@ +createOne(); + + $expected = $this->serializer + ->user($user); + $response = $this + ->actingAs(User::factory()->createOne()) + ->jsonApi('users') + ->delete(url('/api/v1/users', $expected['id'])); + + $response->assertNotFound() + ->assertHasError(404, [ + 'detail' => 'not found message', + 'status' => '404', + 'title' => 'Not Found', + ]); + } +} From db53f2f69355180938166789198c6ae3aba84b44 Mon Sep 17 00:00:00 2001 From: Christopher Gammie Date: Sun, 1 Dec 2024 19:43:48 +0000 Subject: [PATCH 18/28] build!: update changelog, bump branch alias and prep for major release --- CHANGELOG.md | 10 ++++++++++ composer.json | 4 ++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f404766..fa658b6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file. This projec ## Unreleased +### Changed + +- [#298](https://github.com/laravel-json-api/laravel/pull/298) + and [#70](https://github.com/laravel-json-api/laravel/issues/70) The authorizer implementation now allows methods to + return either `bool` or an Illuminate Auth `Response`. +- **BREAKING** The return type for the `authorizeResource()` method on both resource and query request classes has + changed to `bool|Response` (where response is the Illuminate Auth response). If you are manually calling this method + and relying on the return value being a boolean, this change is breaking. However, the vast majority of applications + should be able to upgrade without any changes. + ## [4.1.1] - 2024-11-30 ### Fixed diff --git a/composer.json b/composer.json index 7516ea9..e6fb771 100644 --- a/composer.json +++ b/composer.json @@ -25,7 +25,7 @@ "require": { "php": "^8.2", "ext-json": "*", - "laravel-json-api/core": "^4.3.2|^5.0.1", + "laravel-json-api/core": "^5.0.1", "laravel-json-api/eloquent": "^4.4", "laravel-json-api/encoder-neomerx": "^4.1", "laravel-json-api/exceptions": "^3.1", @@ -53,7 +53,7 @@ }, "extra": { "branch-alias": { - "dev-develop": "4.x-dev" + "dev-develop": "5.x-dev" }, "laravel": { "aliases": { From ee6e2f43aa80be57d63f293bdbcd4eb99dd3642d Mon Sep 17 00:00:00 2001 From: Christopher Gammie Date: Sun, 1 Dec 2024 19:44:31 +0000 Subject: [PATCH 19/28] feat: update authorizer stub --- stubs/authorizer.stub | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/stubs/authorizer.stub b/stubs/authorizer.stub index 1cd9ba8..8fdc6c9 100644 --- a/stubs/authorizer.stub +++ b/stubs/authorizer.stub @@ -2,6 +2,7 @@ namespace {{ namespace }}; +use Illuminate\Auth\Access\Response; use Illuminate\Http\Request; use LaravelJsonApi\Contracts\Auth\Authorizer; @@ -13,9 +14,9 @@ class {{ class }} implements Authorizer * * @param Request $request * @param string $modelClass - * @return bool + * @return bool|Response */ - public function index(Request $request, string $modelClass): bool + public function index(Request $request, string $modelClass): bool|Response { // TODO: Implement index() method. } @@ -25,9 +26,9 @@ class {{ class }} implements Authorizer * * @param Request $request * @param string $modelClass - * @return bool + * @return bool|Response */ - public function store(Request $request, string $modelClass): bool + public function store(Request $request, string $modelClass): bool|Response { // TODO: Implement store() method. } @@ -37,9 +38,9 @@ class {{ class }} implements Authorizer * * @param Request $request * @param object $model - * @return bool + * @return bool|Response */ - public function show(Request $request, object $model): bool + public function show(Request $request, object $model): bool|Response { // TODO: Implement show() method. } @@ -49,9 +50,9 @@ class {{ class }} implements Authorizer * * @param object $model * @param Request $request - * @return bool + * @return bool|Response */ - public function update(Request $request, object $model): bool + public function update(Request $request, object $model): bool|Response { // TODO: Implement update() method. } @@ -61,9 +62,9 @@ class {{ class }} implements Authorizer * * @param Request $request * @param object $model - * @return bool + * @return bool|Response */ - public function destroy(Request $request, object $model): bool + public function destroy(Request $request, object $model): bool|Response { // TODO: Implement destroy() method. } @@ -74,9 +75,9 @@ class {{ class }} implements Authorizer * @param Request $request * @param object $model * @param string $fieldName - * @return bool + * @return bool|Response */ - public function showRelated(Request $request, object $model, string $fieldName): bool + public function showRelated(Request $request, object $model, string $fieldName): bool|Response { // TODO: Implement showRelated() method. } @@ -87,9 +88,9 @@ class {{ class }} implements Authorizer * @param Request $request * @param object $model * @param string $fieldName - * @return bool + * @return bool|Response */ - public function showRelationship(Request $request, object $model, string $fieldName): bool + public function showRelationship(Request $request, object $model, string $fieldName): bool|Response { // TODO: Implement showRelationship() method. } @@ -100,9 +101,9 @@ class {{ class }} implements Authorizer * @param Request $request * @param object $model * @param string $fieldName - * @return bool + * @return bool|Response */ - public function updateRelationship(Request $request, object $model, string $fieldName): bool + public function updateRelationship(Request $request, object $model, string $fieldName): bool|Response { // TODO: Implement updateRelationship() method. } @@ -113,9 +114,9 @@ class {{ class }} implements Authorizer * @param Request $request * @param object $model * @param string $fieldName - * @return bool + * @return bool|Response */ - public function attachRelationship(Request $request, object $model, string $fieldName): bool + public function attachRelationship(Request $request, object $model, string $fieldName): bool|Response { // TODO: Implement attachRelationship() method. } @@ -126,9 +127,9 @@ class {{ class }} implements Authorizer * @param Request $request * @param object $model * @param string $fieldName - * @return bool + * @return bool|Response */ - public function detachRelationship(Request $request, object $model, string $fieldName): bool + public function detachRelationship(Request $request, object $model, string $fieldName): bool|Response { // TODO: Implement detachRelationship() method. } From b2edf37c27bcead77b90cddcbb6f49a1491a68d6 Mon Sep 17 00:00:00 2001 From: Christopher Gammie Date: Sun, 1 Dec 2024 19:48:47 +0000 Subject: [PATCH 20/28] docs: update changelog and bump version --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index fa658b6..0a97dc8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ All notable changes to this project will be documented in this file. This projec ## Unreleased +## [5.0.0] - 2025-12-01 + ### Changed - [#298](https://github.com/laravel-json-api/laravel/pull/298) From 39db9638bf79ad8bb0f87a7b680a665bba7536e2 Mon Sep 17 00:00:00 2001 From: Gregory Haddow Date: Mon, 2 Dec 2024 11:15:39 +0000 Subject: [PATCH 21/28] fix: authorizer response with status should be honoured when unauthenticated --- src/Http/Requests/FormRequest.php | 4 +++- tests/dummy/app/Policies/UserPolicy.php | 6 +++--- tests/dummy/tests/Api/V1/Users/DeleteTest.php | 18 ++++++++++++++++++ 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/src/Http/Requests/FormRequest.php b/src/Http/Requests/FormRequest.php index a4974ca..928b489 100644 --- a/src/Http/Requests/FormRequest.php +++ b/src/Http/Requests/FormRequest.php @@ -254,7 +254,9 @@ protected function passesAuthorization() } } catch (AuthorizationException $ex) { - $this->failIfUnauthenticated(); + if (!$ex->hasStatus()) { + $this->failIfUnauthenticated(); + } throw $ex; } return true; diff --git a/tests/dummy/app/Policies/UserPolicy.php b/tests/dummy/app/Policies/UserPolicy.php index 6fc202c..c2b6224 100644 --- a/tests/dummy/app/Policies/UserPolicy.php +++ b/tests/dummy/app/Policies/UserPolicy.php @@ -55,13 +55,13 @@ public function updatePhone(User $user, User $other): bool /** * Determine if the user can delete the other user. * - * @param User $user + * @param ?User $user * @param User $other * @return bool|Response */ - public function delete(User $user, User $other) + public function delete(?User $user, User $other) { - return $user->is($other) ? true : Response::denyAsNotFound('not found message'); + return $user?->is($other) ? true : Response::denyAsNotFound('not found message'); } } diff --git a/tests/dummy/tests/Api/V1/Users/DeleteTest.php b/tests/dummy/tests/Api/V1/Users/DeleteTest.php index 4980767..6679084 100644 --- a/tests/dummy/tests/Api/V1/Users/DeleteTest.php +++ b/tests/dummy/tests/Api/V1/Users/DeleteTest.php @@ -35,4 +35,22 @@ public function test(): void 'title' => 'Not Found', ]); } + + public function testUnauthenticated(): void + { + $user = User::factory()->createOne(); + + $expected = $this->serializer + ->user($user); + $response = $this + ->jsonApi('users') + ->delete(url('/api/v1/users', $expected['id'])); + + $response->assertNotFound() + ->assertHasError(404, [ + 'detail' => 'not found message', + 'status' => '404', + 'title' => 'Not Found', + ]); + } } From d2815a700ea8f79d15ab965cf00d5ca8e0450022 Mon Sep 17 00:00:00 2001 From: Christopher Gammie Date: Mon, 2 Dec 2024 17:26:51 +0000 Subject: [PATCH 22/28] tests: tidy up user delete test --- tests/dummy/tests/Api/V1/Users/DeleteTest.php | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/tests/dummy/tests/Api/V1/Users/DeleteTest.php b/tests/dummy/tests/Api/V1/Users/DeleteTest.php index 6679084..135ea71 100644 --- a/tests/dummy/tests/Api/V1/Users/DeleteTest.php +++ b/tests/dummy/tests/Api/V1/Users/DeleteTest.php @@ -16,20 +16,16 @@ class DeleteTest extends TestCase { - public function test(): void { $user = User::factory()->createOne(); - $expected = $this->serializer - ->user($user); $response = $this ->actingAs(User::factory()->createOne()) ->jsonApi('users') - ->delete(url('/api/v1/users', $expected['id'])); + ->delete(url('/api/v1/users', $user)); - $response->assertNotFound() - ->assertHasError(404, [ + $response->assertNotFound()->assertErrorStatus([ 'detail' => 'not found message', 'status' => '404', 'title' => 'Not Found', @@ -40,14 +36,11 @@ public function testUnauthenticated(): void { $user = User::factory()->createOne(); - $expected = $this->serializer - ->user($user); $response = $this ->jsonApi('users') - ->delete(url('/api/v1/users', $expected['id'])); + ->delete(url('/api/v1/users', $user)); - $response->assertNotFound() - ->assertHasError(404, [ + $response->assertNotFound()->assertErrorStatus([ 'detail' => 'not found message', 'status' => '404', 'title' => 'Not Found', From fd0bf659cd035457aaf061c9701471bff77cc50a Mon Sep 17 00:00:00 2001 From: Christopher Gammie Date: Mon, 2 Dec 2024 17:28:21 +0000 Subject: [PATCH 23/28] docs: update changelog and bump version --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a97dc8..f6912ac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file. This projec ## Unreleased +## [5.0.1] - 2025-12-02 + +### Fixed + +- [#301](https://github.com/laravel-json-api/laravel/pull/301) Do not override response status when authorization + exception is thrown. + ## [5.0.0] - 2025-12-01 ### Changed From f84bd21051a81f1ad06194abc7c0a9e0dec2cd84 Mon Sep 17 00:00:00 2001 From: Gregory Haddow Date: Tue, 3 Dec 2024 20:29:51 +0000 Subject: [PATCH 24/28] fix: authorizer response should be honoured on destroy action when no request class for resource --- src/Http/Controllers/Actions/Destroy.php | 18 +++++-- tests/dummy/app/Policies/TagPolicy.php | 25 ++++++++++ tests/dummy/routes/api.php | 3 ++ tests/dummy/tests/Api/V1/Tags/DeleteTest.php | 50 ++++++++++++++++++++ 4 files changed, 93 insertions(+), 3 deletions(-) create mode 100644 tests/dummy/app/Policies/TagPolicy.php create mode 100644 tests/dummy/tests/Api/V1/Tags/DeleteTest.php diff --git a/src/Http/Controllers/Actions/Destroy.php b/src/Http/Controllers/Actions/Destroy.php index 8ab981b..6e85a1b 100644 --- a/src/Http/Controllers/Actions/Destroy.php +++ b/src/Http/Controllers/Actions/Destroy.php @@ -12,6 +12,7 @@ namespace LaravelJsonApi\Laravel\Http\Controllers\Actions; use Illuminate\Auth\Access\AuthorizationException; +use Illuminate\Auth\Access\Response as AuthResponse; use Illuminate\Auth\AuthenticationException; use Illuminate\Contracts\Support\Responsable; use Illuminate\Http\Response; @@ -63,13 +64,24 @@ public function destroy(Route $route, StoreContract $store) * So we need to trigger authorization in this case. */ if (!$request) { - $check = $route->authorizer()->destroy( + $result = $route->authorizer()->destroy( $request = \request(), $model, ); - throw_if(false === $check && Auth::guest(), new AuthenticationException()); - throw_if(false === $check, new AuthorizationException()); + if ($result instanceof AuthResponse) { + try { + $result->authorize(); + } catch (AuthorizationException $ex) { + if (!$ex->hasStatus()) { + throw_if(Auth::guest(), new AuthenticationException()); + } + throw $ex; + } + } + + throw_if(false === $result && Auth::guest(), new AuthenticationException()); + throw_if(false === $result, new AuthorizationException()); } $response = null; diff --git a/tests/dummy/app/Policies/TagPolicy.php b/tests/dummy/app/Policies/TagPolicy.php new file mode 100644 index 0000000..ff13681 --- /dev/null +++ b/tests/dummy/app/Policies/TagPolicy.php @@ -0,0 +1,25 @@ +prefix('v1') @@ -35,4 +36,6 @@ $server->resource('videos')->relationships(function ($relationships) { $relationships->hasMany('tags'); }); + + $server->resource('tags', '\\' . JsonApiController::class)->only('destroy'); }); diff --git a/tests/dummy/tests/Api/V1/Tags/DeleteTest.php b/tests/dummy/tests/Api/V1/Tags/DeleteTest.php new file mode 100644 index 0000000..ebb5460 --- /dev/null +++ b/tests/dummy/tests/Api/V1/Tags/DeleteTest.php @@ -0,0 +1,50 @@ +createOne(); + + $response = $this + ->actingAs(User::factory()->createOne()) + ->jsonApi('users') + ->delete(url('/api/v1/tags', $tag)); + + $response->assertNotFound()->assertErrorStatus([ + 'detail' => 'not found message', + 'status' => '404', + 'title' => 'Not Found', + ]); + } + + public function testUnauthenticated(): void + { + $tag = Tag::factory()->createOne(); + + $response = $this + ->jsonApi('users') + ->delete(url('/api/v1/tags', $tag)); + + $response->assertNotFound()->assertErrorStatus([ + 'detail' => 'not found message', + 'status' => '404', + 'title' => 'Not Found', + ]); + } +} From 87442c6426b854a33389e34faebf730256494c48 Mon Sep 17 00:00:00 2001 From: Christopher Gammie Date: Tue, 3 Dec 2024 20:42:52 +0000 Subject: [PATCH 25/28] docs: update changelog and bump version --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f6912ac..bd4fa13 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file. This projec ## Unreleased +## [5.0.2] - 2025-12-03 + +### Fixed + +- [#302](https://github.com/laravel-json-api/laravel/pull/302) Ensure auth response is used when deleting a resource + that does not have a resource response class. + ## [5.0.1] - 2025-12-02 ### Fixed From 3456717d116c375c25276a8811e2d35447937525 Mon Sep 17 00:00:00 2001 From: Christopher Gammie Date: Mon, 24 Feb 2025 20:18:02 +0000 Subject: [PATCH 26/28] feat: add support for Laravel 12 --- .github/workflows/tests.yml | 14 ++++++++++---- composer.json | 22 +++++++++++----------- 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1f1b5a4..d9d6048 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -2,9 +2,15 @@ name: Tests on: push: - branches: [ main, develop, 3.x ] + branches: + - main + - develop + - 3.x pull_request: - branches: [ main, develop, 3.x ] + branches: + - main + - develop + - 3.x jobs: build: @@ -14,8 +20,8 @@ jobs: strategy: fail-fast: true matrix: - php: [8.2, 8.3, 8.4] - laravel: [11] + php: [ 8.2, 8.3, 8.4 ] + laravel: [ 11, 12 ] steps: - name: Checkout Code diff --git a/composer.json b/composer.json index e6fb771..4f187ca 100644 --- a/composer.json +++ b/composer.json @@ -25,18 +25,18 @@ "require": { "php": "^8.2", "ext-json": "*", - "laravel-json-api/core": "^5.0.1", - "laravel-json-api/eloquent": "^4.4", - "laravel-json-api/encoder-neomerx": "^4.1", - "laravel-json-api/exceptions": "^3.1", - "laravel-json-api/spec": "^3.1", - "laravel-json-api/validation": "^4.2", - "laravel/framework": "^11.0" + "laravel-json-api/core": "^5.2", + "laravel-json-api/eloquent": "^4.5", + "laravel-json-api/encoder-neomerx": "^4.2", + "laravel-json-api/exceptions": "^3.2", + "laravel-json-api/spec": "^3.2", + "laravel-json-api/validation": "^4.3", + "laravel/framework": "^11.0|^12.0" }, "require-dev": { - "laravel-json-api/testing": "^3.0.2", - "orchestra/testbench": "^9.0", - "phpunit/phpunit": "^10.5" + "laravel-json-api/testing": "^3.1", + "orchestra/testbench": "^9.0|^10.0", + "phpunit/phpunit": "^10.5|^11.0" }, "autoload": { "psr-4": { @@ -65,7 +65,7 @@ ] } }, - "minimum-stability": "stable", + "minimum-stability": "dev", "prefer-stable": true, "config": { "sort-packages": true From 9ec6f44b10373bcd735b00d6521eb07222906f98 Mon Sep 17 00:00:00 2001 From: Christopher Gammie Date: Mon, 24 Feb 2025 20:52:41 +0000 Subject: [PATCH 27/28] build(deps): update to stable dependencies --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 4f187ca..a91b5fb 100644 --- a/composer.json +++ b/composer.json @@ -65,7 +65,7 @@ ] } }, - "minimum-stability": "dev", + "minimum-stability": "stable", "prefer-stable": true, "config": { "sort-packages": true From 1d9955f56c5d142ba87582b342afe18b96e76bbf Mon Sep 17 00:00:00 2001 From: Christopher Gammie Date: Mon, 24 Feb 2025 20:53:37 +0000 Subject: [PATCH 28/28] docs: update changelog and bump version --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bd4fa13..5b87944 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. This projec ## Unreleased +## [5.1.0] - 2025-02-24 + +### Added + +- Package now supports Laravel 12. + ## [5.0.2] - 2025-12-03 ### Fixed