We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
toPrettyJson
1 parent 3c62dfd commit afab4caCopy full SHA for afab4ca
collections.md
@@ -230,6 +230,7 @@ For the majority of the remaining collection documentation, we'll discuss each m
230
[times](#method-times)
231
[toArray](#method-toarray)
232
[toJson](#method-tojson)
233
+[toPrettyJson](#method-toprettyjson)
234
[transform](#method-transform)
235
[undot](#method-undot)
236
[union](#method-union)
@@ -3333,6 +3334,17 @@ $collection->toJson();
3333
3334
// '{"name":"Desk", "price":200}'
3335
```
3336
3337
+<a name="method-toprettyjson"></a>
3338
+#### `toPrettyJson()` {.collection-method}
3339
+
3340
+The `toPrettyJson` method converts the collection into a formatted JSON string using the `JSON_PRETTY_PRINT` option:
3341
3342
+```php
3343
+$collection = collect(['name' => 'Desk', 'price' => 200]);
3344
3345
+$collection->toPrettyJson();
3346
+```
3347
3348
<a name="method-transform"></a>
3349
#### `transform()` {.collection-method}
3350
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
0 commit comments