From a8b879c9f3e1db44698443418b31a8bf5e14c916 Mon Sep 17 00:00:00 2001 From: Haoran Date: Wed, 28 Nov 2018 08:32:59 +1100 Subject: [PATCH] Add a ->first() as requested for scopeMetaLike(). --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 18ab08eb..3abc2975 100644 --- a/README.md +++ b/README.md @@ -264,7 +264,7 @@ There are multiples possibilities to query posts by their custom fields (meta) b To check if a meta key exists, use the `hasMeta()` scope: ``` // Finds a published post with a meta flag. -$post = Post::published()->hasMeta('featured_article'); +$post = Post::published()->hasMeta('featured_article')->first(); ``` If you want to precisely match a meta-field, you can use the `hasMeta()` scope with a value.