Skip to content

Commit b8cc281

Browse files
committed
[Docs] Update changelog and bump version
1 parent 97f1263 commit b8cc281

File tree

1 file changed

+22
-21
lines changed

1 file changed

+22
-21
lines changed

CHANGELOG.md

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,42 +3,43 @@
33
All notable changes to this project will be documented in this file. This project adheres to
44
[Semantic Versioning](http://semver.org/) and [this changelog format](http://keepachangelog.com/).
55

6-
## Unreleased
6+
## [1.0.0-alpha.2] - 2021-02-02
77

88
### Added
9+
910
- [#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.
1314
- 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.
1919

2020
### Changed
21+
2122
- **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.
2928

3029
### Fixed
30+
3131
- [#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.
3434
- Package discovery for sub-packages that have service providers now works correctly.
3535

3636
### Removed
37+
3738
- **BREAKING** The `Arr` schema field has been removed - use the new `ArrayList` or `ArrayHash`
38-
fields instead.
39+
fields instead.
3940
- **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).
4243

4344
## [1.0.0-alpha.1] - 2021-01-25
4445

0 commit comments

Comments
 (0)