We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 91e9e4b commit 8131d17Copy full SHA for 8131d17
eloquent-mutators.md
@@ -364,6 +364,25 @@ $user = User::find(1);
364
$user->update(['options->key' => 'value']);
365
```
366
367
+<a name="json-and-unicode"></a>
368
+#### JSON and Unicode
369
+
370
+If you would like to store an array attribute as JSON with unescaped Unicode characters, you may use the `json:unicode` cast:
371
372
+```php
373
+/**
374
+ * Get the attributes that should be cast.
375
+ *
376
+ * @return array<string, string>
377
+ */
378
+protected function casts(): array
379
+{
380
+ return [
381
+ 'options' => 'json:unicode',
382
+ ];
383
+}
384
+```
385
386
<a name="array-object-and-collection-casting"></a>
387
#### Array Object and Collection Casting
388
0 commit comments