Laravel model json column cast nested element
I have a User model that stored credentials as json in db. class User extends Model { protected $casts = [ 'credentials' => 'array', ]; } $user = User::find(1); $user->credentials = ['username' => 'john', 'pass' => 'mypass']; $user->save(); How do…