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: docs/source/handling_meta.rst
+12-1
Original file line number
Diff line number
Diff line change
@@ -149,7 +149,18 @@ You can enforce that any meta attached to a particular key is always of a partic
149
149
'children' => 'collection:\App\ExampleMetable',
150
150
];
151
151
152
-
//...
152
+
// equivalent to:
153
+
protected function metaCasts(): array
154
+
{
155
+
return [
156
+
'optin' => 'boolean',
157
+
'age' => 'integer',
158
+
'secret' => 'encrypted:string',
159
+
'parent' => ExampleMetable::class,
160
+
'children' => 'collection:\App\ExampleMetable',
161
+
];
162
+
}
163
+
153
164
}
154
165
155
166
All `cast types supported by Eloquent<https://laravel.com/docs/11.x/eloquent-mutators#attribute-casting>`_ are supported, with the following modifications:
0 commit comments