|
3 | 3 | All notable changes to this project will be documented in this file. This project adheres to |
4 | 4 | [Semantic Versioning](http://semver.org/) and [this changelog format](http://keepachangelog.com/). |
5 | 5 |
|
6 | | -## Unreleased |
| 6 | +## [1.0.0-alpha.2] - 2021-02-02 |
7 | 7 |
|
8 | 8 | ### Added |
| 9 | + |
9 | 10 | - [#1](https://github.com/laravel-json-api/laravel/pull/1) |
10 | | -Resource classes are now optional. If one is not defined, the implementation falls-back to |
11 | | -using the Eloquent schema to serialize a model. Eloquent schema fields now have new |
12 | | -`hidden` and `serializeUsing` methods to customise the serialization of models by the schema. |
| 11 | + Resource classes are now optional. If one is not defined, the implementation falls-back to using the Eloquent schema |
| 12 | + to serialize a model. Eloquent schema fields now have new |
| 13 | + `hidden` and `serializeUsing` methods to customise the serialization of models by the schema. |
13 | 14 | - Resource classes now support using conditional attributes in their `meta()` method. |
14 | | -- New field classes `ArrayList` and `ArrayHash` have been added, to distinguish between |
15 | | -PHP zero-indexed arrays that serialize to JSON arrays (`ArrayList`) and PHP associative |
16 | | -arrays that serialize to JSON objects (`ArrayHash`). The distinction is required because |
17 | | -an empty array list can be serialized to `[]` in JSON whereas an empty associative array |
18 | | -must be serialized to `null` in JSON. |
| 15 | +- New field classes `ArrayList` and `ArrayHash` have been added, to distinguish between PHP zero-indexed arrays that |
| 16 | + serialize to JSON arrays (`ArrayList`) and PHP associative arrays that serialize to JSON objects (`ArrayHash`). The |
| 17 | + distinction is required because an empty array list can be serialized to `[]` in JSON whereas an empty associative |
| 18 | + array must be serialized to `null` in JSON. |
19 | 19 |
|
20 | 20 | ### Changed |
| 21 | + |
21 | 22 | - **BREAKING** The JsonApiResource method signatures for the `attributes()`, `relationships()`, |
22 | | -`meta()`, and `links()` methods have been changed so that they receive the HTTP request as the |
23 | | -first (and only) parameter. This brings the implementation in line with Laravel's Eloquent |
24 | | -resources, which receive the request to their `toArray()` method. The slight difference is |
25 | | -our implementation allows the request to be `null` - this is to cover encoding resources |
26 | | -outside of HTTP requests, e.g. queued broadcasting. When upgrading, you will need to either |
27 | | -delete resource classes (as they are now optional), or update the method signatures on any |
28 | | -classes you are retaining. |
| 23 | + `meta()`, and `links()` methods have been changed so that they receive the HTTP request as the first (and only) |
| 24 | + parameter. This brings the implementation in line with Laravel's Eloquent resources, which receive the request to |
| 25 | + their `toArray()` method. The slight difference is our implementation allows the request to be `null` - this is to |
| 26 | + cover encoding resources outside of HTTP requests, e.g. queued broadcasting. When upgrading, you will need to either |
| 27 | + delete resource classes (as they are now optional), or update the method signatures on any classes you are retaining. |
29 | 28 |
|
30 | 29 | ### Fixed |
| 30 | + |
31 | 31 | - [#3](https://github.com/laravel-json-api/laravel/issues/3) |
32 | | - Example server registration in the published configuration file prevented developer from creating |
33 | | - a `v1` server after adding this package to their Laravel application. |
| 32 | + Example server registration in the published configuration file prevented developer from creating a `v1` server after |
| 33 | + adding this package to their Laravel application. |
34 | 34 | - Package discovery for sub-packages that have service providers now works correctly. |
35 | 35 |
|
36 | 36 | ### Removed |
| 37 | + |
37 | 38 | - **BREAKING** The `Arr` schema field has been removed - use the new `ArrayList` or `ArrayHash` |
38 | | -fields instead. |
| 39 | + fields instead. |
39 | 40 | - **BREAKING** The `uri` method on resource and relationship routes has been removed: |
40 | | - - The resource type URI can now be set on the resource's schema (using the `$uriType` property). |
41 | | - - Relationship URIs are now set on the schema field for the relationship (via the `withUriFieldName` method). |
| 41 | + - The resource type URI can now be set on the resource's schema (using the `$uriType` property). |
| 42 | + - Relationship URIs are now set on the schema field for the relationship (via the `withUriFieldName` method). |
42 | 43 |
|
43 | 44 | ## [1.0.0-alpha.1] - 2021-01-25 |
44 | 45 |
|
|
0 commit comments