Skip to content

Commit aebc453

Browse files
committed
Merge branch 'develop' of github.com:laravel-json-api/docs into develop
2 parents b51f9ec + 657b914 commit aebc453

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

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) {
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) {
332+
$post->author()->associate(Auth::user());
333+
});
330334
}
331335
```
332336

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) {
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) {
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