<?php

namespace AuthStack\SystemUser\Model;

use Illuminate\Database\Eloquent\Model;

class SystemUser extends Model
{
    protected $table = 'system_users';
    protected $fillable = ['password', 'email', 'first_name', 'last_name', 'date_format', 'config'];
    public $timestamps = true;

    protected $casts = [
        'config' => 'array',
    ];

    public function setConfigAttribute($value)
    {
        $this->attributes['config'] = json_encode($value, JSON_UNESCAPED_SLASHES);
    }
}