Replies: 1 comment
-
Are using a custom pivot model? https://laravel.com/docs/9.x/eloquent-relationships#defining-custom-intermediate-table-models In this custom pivot model you can add the https://laravel.com/docs/9.x/eloquent-mutators#attribute-casting |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I use the latest Laravel and PHP 8
I have a pivot table with a meta field which is a JSON, and then I cast like an object (and I tried with array).
$variant->pivot->meta->default_value
I have an error, it says meta is a string.
Beta Was this translation helpful? Give feedback.
All reactions