Initial commit

This commit is contained in:
root
2026-05-09 17:28:23 +02:00
commit 9d73f82529
5575 changed files with 281989 additions and 0 deletions
+39
View File
@@ -0,0 +1,39 @@
<?php
declare(strict_types=1);
namespace App\Enums;
enum AchievementCategory: string
{
case Identity = 'identity';
case Explore = 'explore';
case Music = 'music';
case Social = 'social';
case Games = 'games';
case RoomBuilder = 'room_builder';
case Pets = 'pets';
case Tools = 'tools';
case Events = 'events';
/**
* @return array<string>
*/
public static function values(): array
{
return array_column(self::cases(), 'value');
}
/**
* @return array<string, string>
*/
public static function toInput(): array
{
$allCurrencies = self::cases();
return array_combine(
array_column($allCurrencies, 'value'),
array_column($allCurrencies, 'name'),
);
}
}
+21
View File
@@ -0,0 +1,21 @@
<?php
declare(strict_types=1);
namespace App\Enums;
enum AlertChannel: string
{
case EMAIL = 'email';
case DISCORD = 'discord';
case BOTH = 'both';
public function getLabel(): string
{
return match ($this) {
self::EMAIL => 'E-mail',
self::DISCORD => 'Discord',
self::BOTH => 'Beide',
};
}
}
+33
View File
@@ -0,0 +1,33 @@
<?php
declare(strict_types=1);
namespace App\Enums;
enum AlertSeverity: string
{
case INFO = 'info';
case WARNING = 'warning';
case ERROR = 'error';
case CRITICAL = 'critical';
public function getColor(): string
{
return match ($this) {
self::INFO => 'blue',
self::WARNING => 'yellow',
self::ERROR => 'orange',
self::CRITICAL => 'red',
};
}
public function getEmoji(): string
{
return match ($this) {
self::INFO => '️',
self::WARNING => '⚠️',
self::ERROR => '❌',
self::CRITICAL => '🚨',
};
}
}
+74
View File
@@ -0,0 +1,74 @@
<?php
declare(strict_types=1);
namespace App\Enums;
enum AlertType: string
{
case EMULATOR_OFFLINE = 'emulator_offline';
case EMULATOR_ONLINE = 'emulator_online';
case EMULATOR_ERROR = 'emulator_error';
case DDOS_DETECTED = 'ddos_detected';
case DDOS_BLOCKED = 'ddos_blocked';
case HIGH_ERROR_RATE = 'high_error_rate';
case CRITICAL_ERROR = 'critical_error';
case QUEUE_FAILED = 'queue_failed';
case DATABASE_ERROR = 'database_error';
case SSL_EXPIRED = 'ssl_expired';
case DISK_SPACE_LOW = 'disk_space_low';
case MEMORY_WARNING = 'memory_warning';
case EMULATOR_UPDATE = 'emulator_update';
case SQL_UPDATE = 'sql_update';
public function getLabel(): string
{
return match ($this) {
self::EMULATOR_OFFLINE => 'Emulator Offline',
self::EMULATOR_ONLINE => 'Emulator Online',
self::EMULATOR_ERROR => 'Emulator Error',
self::DDOS_DETECTED => 'DDoS Gedetecteerd',
self::DDOS_BLOCKED => 'DDoS Geblokkeerd',
self::HIGH_ERROR_RATE => 'Hoge Error Rate',
self::CRITICAL_ERROR => 'Kritieke Error',
self::QUEUE_FAILED => 'Queue Failed',
self::DATABASE_ERROR => 'Database Error',
self::SSL_EXPIRED => 'SSL Verlopen',
self::DISK_SPACE_LOW => 'Weinig Schijfruimte',
self::MEMORY_WARNING => 'Geheugen Waarschuwing',
self::EMULATOR_UPDATE => 'Emulator Update',
self::SQL_UPDATE => 'SQL Update',
};
}
public function getSeverity(): AlertSeverity
{
return match ($this) {
self::EMULATOR_OFFLINE, self::DDOS_DETECTED, self::CRITICAL_ERROR => AlertSeverity::CRITICAL,
self::EMULATOR_ERROR, self::HIGH_ERROR_RATE, self::QUEUE_FAILED, self::DATABASE_ERROR, self::SSL_EXPIRED => AlertSeverity::ERROR,
self::DDOS_BLOCKED, self::DISK_SPACE_LOW, self::MEMORY_WARNING => AlertSeverity::WARNING,
self::EMULATOR_UPDATE, self::SQL_UPDATE => AlertSeverity::INFO,
self::EMULATOR_ONLINE => AlertSeverity::INFO,
};
}
public function getIcon(): string
{
return match ($this) {
self::EMULATOR_OFFLINE => 'heroicon-o-server',
self::EMULATOR_ONLINE => 'heroicon-o-server',
self::EMULATOR_ERROR => 'heroicon-o-exclamation-triangle',
self::DDOS_DETECTED => 'heroicon-o-shield-exclamation',
self::DDOS_BLOCKED => 'heroicon-o-shield-check',
self::HIGH_ERROR_RATE => 'heroicon-o-arrow-trending-up',
self::CRITICAL_ERROR => 'heroicon-o-x-circle',
self::QUEUE_FAILED => 'heroicon-o-queue-list',
self::DATABASE_ERROR => 'heroicon-o-database',
self::SSL_EXPIRED => 'heroicon-o-lock-closed',
self::DISK_SPACE_LOW => 'heroicon-o-hard-drive',
self::MEMORY_WARNING => 'heroicon-o-cpu-chip',
self::EMULATOR_UPDATE => 'heroicon-o-arrow-down-tray',
self::SQL_UPDATE => 'heroicon-o-document-arrow-down',
};
}
}
+55
View File
@@ -0,0 +1,55 @@
<?php
namespace App\Enums;
enum CurrencyTypes: int
{
case Credits = -1;
case Duckets = 0;
case Diamonds = 5;
case Points = 101;
/**
* @return array<int>
*/
public static function values(): array
{
return array_column(self::cases(), 'value');
}
public static function fromCurrencyName(string $currencyName): ?self
{
$currencyName = strtolower($currencyName);
return match ($currencyName) {
'credits' => self::Credits,
'duckets' => self::Duckets,
'diamonds' => self::Diamonds,
'points' => self::Points,
default => null,
};
}
public function getImage(): string
{
return match ($this->value) {
CurrencyTypes::Credits->value => asset('assets/images/currencies/credits.gif'),
CurrencyTypes::Duckets->value => asset('assets/images/currencies/duckets.png'),
CurrencyTypes::Diamonds->value => asset('assets/images/currencies/diamonds.png'),
CurrencyTypes::Points->value => asset('assets/images/currencies/points.png'),
};
}
/**
* @return array<int, string>
*/
public static function toInput(): array
{
$allCurrencies = self::cases();
return array_combine(
array_column($allCurrencies, 'value'),
array_column($allCurrencies, 'name'),
);
}
}
+11
View File
@@ -0,0 +1,11 @@
<?php
declare(strict_types=1);
namespace App\Enums;
enum NotificationType: string
{
case ArticlePosted = 'article_posted';
case HousekeepingCustomMessage = 'housekeeping_custom_message';
}