Skip to content

Commit e43682e

Browse files
committed
[Feature] Add extract using attribute method and update changelog
1 parent 8717d03 commit e43682e

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,19 @@ All notable changes to this project will be documented in this file. This projec
1717
- [#85](https://github.com/laravel-json-api/laravel/issues/85) When running an application with debug mode turned on,
1818
the default JSON:API error object for an exception will now contain detailed exception information, including the
1919
stack trace, in the object's `meta` member.
20+
- [#103](https://github.com/laravel-json-api/laravel/issues/103) Can now fully customise attribute serialization to JSON
21+
using the `extractUsing()` callback. This receives the model, column name and value. This is useful if the developer
22+
needs to control the serialization of a few fields on their schema. However, the recommendation is to use a resource
23+
class for complete control over the serialization of a model to a JSON:API resource.
2024

2125
### Changed
2226

2327
- Minimum Laravel version is now `8.30`. This change was required to use the `$stopOnFirstFailure` property on Laravel's
2428
`FormRequest` class.
29+
- Schema classes no longer automatically sort their fields by name when iterating over them. This change was made to
30+
give the developer full control over the order of fields (particularly as this order affects the order in which fields
31+
are listed when serialized to a JSON:API resource). Developers can list fields in name order if that is the preferred
32+
order.
2533
- Removed the `LaravelJsonApi\Spec\UnexpectedDocumentException` which was thrown if there was a failure when decoding
2634
request JSON content before parsing it for compliance with the JSON:API specification. A `JsonApiException` will now
2735
be thrown instead.

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"php": "^7.4|^8.0",
2727
"ext-json": "*",
2828
"laravel-json-api/core": "^1.0.0-beta.5",
29-
"laravel-json-api/eloquent": "^1.0.0-beta.5",
29+
"laravel-json-api/eloquent": "^1.0.0-beta.6",
3030
"laravel-json-api/encoder-neomerx": "^1.0.0-beta.1",
3131
"laravel-json-api/exceptions": "^1.0.0-beta.4",
3232
"laravel-json-api/spec": "^1.0.0-beta.2",

0 commit comments

Comments
 (0)