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>
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
<?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',
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user