From 3a91f6ed3584e45744f3ab339f84f1520c660066 Mon Sep 17 00:00:00 2001 From: brandonkelly Date: Mon, 11 Mar 2024 17:05:07 -0700 Subject: [PATCH] Improve examples --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f90d07e..4af1d7c 100644 --- a/README.md +++ b/README.md @@ -51,9 +51,10 @@ return [ 'criteria' => ['section' => 'news'], 'transformer' => function(Entry $entry) { return [ + 'id' => $entry->id, 'title' => $entry->title, 'url' => $entry->url, - 'jsonUrl' => UrlHelper::url("news/{$entry->id}.json"), + 'jsonUrl' => UrlHelper::url("news/$entry->id.json"), 'summary' => $entry->summary, ]; }, @@ -76,6 +77,7 @@ return [ }, ] ]; + ``` ### Endpoint Configuration Settings @@ -393,7 +395,7 @@ Here are a few endpoint examples, and what their response would look like. return [ 'title' => $entry->title, 'url' => $entry->url, - 'jsonUrl' => UrlHelper::url("ingredients/{$entry->slug}.json"), + 'jsonUrl' => UrlHelper::url("ingredients/$entry->slug.json"), ]; }, 'pretty' => true,