0

I have content(text) field in database . I want to store {"id" : 1} in content field. but using casts instead of json_encode. How can I store it? Any help would be appreciated. I am using laravel 5.6

1 Answer 1

1

Hi You can do like this

  1. Define Cast

__

$options["key"] = "value";

$yourarray->options = $options;

$yourarray->save();

That's All. Hope this will help you.

Sign up to request clarification or add additional context in comments.

1 Comment

Sure. Keep it up. @unknown

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.