Support the ongoing development of Laravel.io →
posted 3 years ago
Eloquent
Last updated 2 years ago.
0

The only way I am aware of is casting your field to a Value Object which defines the type of each property: https://github.com/jessarcher/laravel-castable-data-transfer-object

0

There is nothing available in native laravel casting a JSON, So you must have to create a custom attribute to cast a JSON column key you can check this out: http://laravel.com/docs/5.1/eloquent-serialization#appending-values-to-json

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Neil neil Joined 1 Dec 2020

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.