You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+11-1
Original file line number
Diff line number
Diff line change
@@ -285,6 +285,16 @@ $post = Post::meta()
285
285
286
286
When you need to retrive multiple results from your model, you can eager load `metas`
287
287
288
-
```
288
+
```php
289
289
$post = Post::with(['metas'])->get();
290
290
```
291
+
292
+
#### Prevent metas attribute from being populated
293
+
294
+
When you convert a model to an array (or json) and you don't need all meta fields, you can create a model's property to prevent metas from being added to the resulting array.
295
+
You can also use it on eloquent relations.
296
+
297
+
```php
298
+
/* Post model */
299
+
public $hideMeta = true; // Do not add metas to array
0 commit comments