'datetime', ]; protected static function boot() { parent::boot(); static::deleted(function ($user) { $user->characters()->delete(); }); } public function main_character() { return $this->belongsTo(Character::class, 'character_id'); } public function characters() { return $this->hasMany(Character::class); } public function getRoleAttribute() { if (!$this->attributes['role']) { return 'user'; } return $this->attributes['role']; } }