where(['is_enabled' => true]); } public function getIsActiveAttribute(): bool { return $this->name === App::getLocale(); } public function toggle(): bool { return $this->is_enabled ? $this->disable() : $this->enable(); } public function enable(): bool { return $this->update(['is_enabled' => true]); } public function disable(): bool { return $this->update(['is_enabled' => false]); } public function setAsDefault(): bool { self::query()->where(['is_default' => true])->update(['is_default' => false]); return $this->update(['is_default' => true]); } public static function default() { return self::query()->where(['is_default' => 1])->first(); } }