W3cubDocs

/Laravel 8

SerializesCastableAttributes

interface SerializesCastableAttributes (View source)

Methods

mixed serialize(Model $model, string $key, mixed $value, array $attributes)

Serialize the attribute when converting the model to an array.

Details

mixed serialize(Model $model, string $key, mixed $value, array $attributes)

Serialize the attribute when converting the model to an array.

Parameters

Model $model
string $key
mixed $value
array $attributes

Return Value

mixed

© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/8.x/Illuminate/Contracts/Database/Eloquent/SerializesCastableAttributes.html