public function setPermissionsAttribute(array $permissions) { $this->attributes['permissions'] = $permissions ? json_encode($permissions) : ''; }