Skip to content

Commit 20cf48a

Browse files
committed
Merge branch 'release/2.2.0'
2 parents 51b4a00 + 0e86008 commit 20cf48a

File tree

7 files changed

+17
-9
lines changed

7 files changed

+17
-9
lines changed

1.0/requests/authorization.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ class Server extends BaseServer
499499
{
500500
Post::addGlobalScope(new PostScope());
501501

502-
Post::creating(static function (Post $post) {
502+
Post::creating(static function (Post $post): void {
503503
$post->author()->associate(Auth::user());
504504
});
505505
}

1.0/tutorial/03-server-and-schemas.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -669,5 +669,5 @@ In this chapter, we created our JSON:API server and added our first resource
669669
to it by creating a `PostSchema` class. We also learnt how to register JSON:API
670670
routes and how authentication works.
671671

672-
In the [next chapter](./04-relationships), we'll add relationships to our
672+
In the [next chapter](./04-relationships.md), we'll add relationships to our
673673
`posts` resource.

1.0/tutorial/05-creating-resources.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,9 @@ Open the `app/JsonApi/V1/Server.php` class, and update it as follows:
165165
public function serving(): void
166166
{
167167
- // no-op
168-
+ Post::creating(static fn(Post $post) => $post->author()->associate(Auth::user()));
168+
+ Post::creating(static function (Post $post): void {
169+
+ $post->author()->associate(Auth::user());
170+
+ });
169171
}
170172

171173
/**
@@ -326,7 +328,9 @@ the `serving()` method:
326328
{
327329
+ Auth::shouldUse('sanctum');
328330
+
329-
Post::creating(static fn(Post $post) => $post->author()->associate(Auth::user()));
331+
Post::creating(static function(Post $post): void {
332+
$post->author()->associate(Auth::user());
333+
});
330334
}
331335
```
332336

2.0/digging-deeper/countable.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
## Introduction
66

77
:::danger
8-
Although included in the `1.0` release, the countable relationship feature
8+
Although included in the `2.0` release, the countable relationship feature
99
**is experimental and is not considered ready for production use.** We will be
1010
making changes to this feature that will be breaking from the perspective of an
1111
API client.

2.0/requests/authorization.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ class Server extends BaseServer
499499
{
500500
Post::addGlobalScope(new PostScope());
501501

502-
Post::creating(static function (Post $post) {
502+
Post::creating(static function (Post $post): void {
503503
$post->author()->associate(Auth::user());
504504
});
505505
}

2.0/tutorial/03-server-and-schemas.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -669,5 +669,5 @@ In this chapter, we created our JSON:API server and added our first resource
669669
to it by creating a `PostSchema` class. We also learnt how to register JSON:API
670670
routes and how authentication works.
671671

672-
In the [next chapter](./04-relationships), we'll add relationships to our
672+
In the [next chapter](./04-relationships.md), we'll add relationships to our
673673
`posts` resource.

2.0/tutorial/05-creating-resources.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,9 @@ Open the `app/JsonApi/V1/Server.php` class, and update it as follows:
165165
public function serving(): void
166166
{
167167
- // no-op
168-
+ Post::creating(static fn(Post $post) => $post->author()->associate(Auth::user()));
168+
+ Post::creating(static function (Post $post): void {
169+
+. $post->author()->associate(Auth::user());
170+
+ });
169171
}
170172

171173
/**
@@ -326,7 +328,9 @@ the `serving()` method:
326328
{
327329
+ Auth::shouldUse('sanctum');
328330
+
329-
Post::creating(static fn(Post $post) => $post->author()->associate(Auth::user()));
331+
Post::creating(static function(Post $post): void {
332+
$post->author()->associate(Auth::user());
333+
});
330334
}
331335
```
332336

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy