Wire admin studio SSR and search infrastructure

This commit is contained in:
2026-05-01 11:46:06 +02:00
parent 257b0dbef6
commit 18cea8b0f0
329 changed files with 197465 additions and 2741 deletions

47
app/Enums/UserRole.php Normal file
View File

@@ -0,0 +1,47 @@
<?php
declare(strict_types=1);
namespace App\Enums;
enum UserRole: string
{
case User = 'user';
case Creator = 'creator';
case Moderator = 'moderator';
case Editorial = 'editorial';
case Manager = 'manager';
case Admin = 'admin';
/** Roles that grant access to the /admin panel. */
public static function staffRoles(): array
{
return [self::Editorial, self::Manager, self::Admin];
}
/** Human-friendly label. */
public function label(): string
{
return match ($this) {
self::User => 'User',
self::Creator => 'Creator',
self::Moderator => 'Moderator',
self::Editorial => 'Editorial',
self::Manager => 'Manager',
self::Admin => 'Admin',
};
}
/** Badge color class (Tailwind). */
public function badgeClass(): string
{
return match ($this) {
self::User => 'bg-slate-500/20 text-slate-300',
self::Creator => 'bg-sky-500/20 text-sky-300',
self::Moderator => 'bg-violet-500/20 text-violet-300',
self::Editorial => 'bg-teal-500/20 text-teal-300',
self::Manager => 'bg-amber-500/20 text-amber-300',
self::Admin => 'bg-rose-500/20 text-rose-300',
};
}
}