<?php namespace App; use Illuminate\Database\Eloquent\Model; class User extends Model { /** * The attributes that should be cast to native types. * * @var array */ protected $casts = [ 'options' => 'array', ]; }
$user = App\User::find(1); $options = $user->options; $options['key'] = 'value'; $user->options = $options; $user->save();
Clickable & Draggable!