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>
32 lines
671 B
PHP
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',
|
|
};
|
|
}
|
|
}
|