From 57e8a803d55cde06a2493034512b2cd431b7298d Mon Sep 17 00:00:00 2001 From: Bram Date: Fri, 6 Feb 2026 16:19:45 +0100 Subject: [PATCH 1/3] Make v4 non-breaking --- composer.json | 2 +- src/Resources/JsonApiResource.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 9072ebe..586fb6e 100644 --- a/composer.json +++ b/composer.json @@ -6,7 +6,7 @@ "license": "MIT", "require": { "php": "^8.2", - "laravel/framework": "^8.0 || ^9.0 || ^10.0 || ^11.0 || ^12.0" + "laravel/framework": "^8.0 || ^9.0 || ^10.0 || ^11.0 || (>=12.0 <12.45.0)" }, "autoload": { "psr-4": { diff --git a/src/Resources/JsonApiResource.php b/src/Resources/JsonApiResource.php index 1956e8c..8e6bceb 100644 --- a/src/Resources/JsonApiResource.php +++ b/src/Resources/JsonApiResource.php @@ -185,7 +185,7 @@ protected function getType(): string * Default to either `registerData['attributes']` or an empty array. * Should be overwritten to create custom attributes. */ - public function toAttributes(Request $request): array + protected function toAttributes(Request $request): array { return $this->registerData['attributes'] ?? []; } From 3709fdb24f2ae9c55262bed9d5c623e5eca0de36 Mon Sep 17 00:00:00 2001 From: Bram Date: Fri, 6 Feb 2026 16:31:44 +0100 Subject: [PATCH 2/3] Add V4 comment to readme --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 1dfe882..84037e0 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ Make your Laravel API [JSON:API](https://jsonapi.org/) compliant with the `Brainstud\JsonApi` package. +Specific V4 Branch! + ## Table of contents - [Installation](#installation) From c4c2bbedad2cef5c3746a51d3f9e9e0918b2a3c5 Mon Sep 17 00:00:00 2001 From: Bram Date: Fri, 6 Feb 2026 16:40:35 +0100 Subject: [PATCH 3/3] Update laravel version constraint --- composer.json | 52 +++++++++++++++++++++++++-------------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/composer.json b/composer.json index 586fb6e..f89317a 100644 --- a/composer.json +++ b/composer.json @@ -1,29 +1,29 @@ { - "name": "brainstud/json-api-resource", - "description": "Build JSON:API compliant Laravel API resources", - "minimum-stability": "dev", - "prefer-stable": true, - "license": "MIT", - "require": { - "php": "^8.2", - "laravel/framework": "^8.0 || ^9.0 || ^10.0 || ^11.0 || (>=12.0 <12.45.0)" - }, - "autoload": { - "psr-4": { - "Brainstud\\JsonApi\\": "src/" - } - }, - "autoload-dev": { - "psr-4": { - "Brainstud\\JsonApi\\Tests\\": "tests" - } - }, - "scripts": { - "test": "./vendor/bin/phpunit --configuration ./phpunit.xml" - }, - "require-dev": { - "phpunit/phpunit": "^9.6.3", - "orchestra/testbench": "^7.22.0", - "laravel/pint": "^1.22.0" + "name": "brainstud/json-api-resource", + "description": "Build JSON:API compliant Laravel API resources", + "minimum-stability": "dev", + "prefer-stable": true, + "license": "MIT", + "require": { + "php": "^8.2", + "laravel/framework": "^8.0 || ^9.0 || ^10.0 || ^11.0 || ^12.0, <12.45.0" + }, + "autoload": { + "psr-4": { + "Brainstud\\JsonApi\\": "src/" } + }, + "autoload-dev": { + "psr-4": { + "Brainstud\\JsonApi\\Tests\\": "tests" + } + }, + "scripts": { + "test": "./vendor/bin/phpunit --configuration ./phpunit.xml" + }, + "require-dev": { + "phpunit/phpunit": "^9.6.3", + "orchestra/testbench": "^7.22.0", + "laravel/pint": "^1.22.0" + } }