Files
laralog/app/Filament/Support/AdminEnvironment.php
T
goukiandCursor 469160dc3f
Build and Deploy / verify (push) Failing after 15m17s
Build and Deploy / deploy (push) Skipped
feat: add admin env badge, quick post button, and harden plugin enable
Show local/prod in the Filament topbar, jump to create post in one click, tighten sidebar spacing, and stop Hello World from 500ing when its tables are missing.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-18 08:24:16 +00:00

32 lines
671 B
PHP

<?php
declare(strict_types=1);
namespace App\Filament\Support;
/**
* Admin top-right environment badge: local stays local, production shows as prod.
*/
class AdminEnvironment
{
public static function name(): string
{
$environment = app()->environment();
return match ($environment) {
'production', 'prod' => 'prod',
default => $environment,
};
}
public static function color(): string
{
return match (app()->environment()) {
'production', 'prod' => 'danger',
'local' => 'gray',
'staging' => 'warning',
default => 'info',
};
}
}