From 9bbae0b2723e249290d0f738ddd34b3e6d621e94 Mon Sep 17 00:00:00 2001 From: Adam Nielsen <1765602+iwasherefirst2@users.noreply.github.com> Date: Thu, 28 Nov 2019 12:09:25 +0100 Subject: [PATCH] Update schema.md I think by default one may would like to return the relations `$post->author` and not a single column `$post->createdBy`. Also `createdBy` is not a standard attribute, so I guess it was a typo? --- docs/basics/schemas.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/basics/schemas.md b/docs/basics/schemas.md index c66bd5db..ee208575 100644 --- a/docs/basics/schemas.md +++ b/docs/basics/schemas.md @@ -211,7 +211,7 @@ class Schema extends SchemaProvider return [ 'author' => [ self::DATA => function () use ($post) { - return $post->createdBy; + return $post->author; }, ], ]; @@ -256,7 +256,7 @@ class Schema extends SchemaProvider 'author' => [ self::SHOW_DATA => isset($includeRelationships['author']), self::DATA => function () use ($post) { - return $post->createdBy; + return $post->author; }, ], ]; @@ -337,7 +337,7 @@ class Schema extends SchemaProvider self::SHOW_RELATED => true, self::SHOW_DATA => isset($includeRelationships['author']), self::DATA => function () use ($post) { - return $post->createdBy; + return $post->author; }, ], ];