Laravel 13 + Filament 5 admin panel and REST API for a non-profit developer collective, backed by the Pireon OAuth identity server. The public site is a separate, server-rendered application consuming /api/public/v1. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
46 lines
1.2 KiB
PHP
46 lines
1.2 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Enums;
|
|
|
|
use Filament\Support\Contracts\HasColor;
|
|
use Filament\Support\Contracts\HasLabel;
|
|
|
|
/**
|
|
* What has been decided about an address that does not resolve.
|
|
*
|
|
* `Ignored` exists so the list stays readable. Most of what a public site is
|
|
* asked for is a bot looking for somebody else's admin panel, and a list where
|
|
* the real broken links are buried under that noise is a list nobody opens.
|
|
* Ignoring keeps counting — it hides a row, it does not stop the record.
|
|
*/
|
|
enum MissingUrlStatus: string implements HasColor, HasLabel
|
|
{
|
|
case Pending = 'pending';
|
|
case Resolved = 'resolved';
|
|
case Ignored = 'ignored';
|
|
|
|
public function getLabel(): string
|
|
{
|
|
return __("enums.missing_url_status.{$this->value}");
|
|
}
|
|
|
|
public function getColor(): string
|
|
{
|
|
return match ($this) {
|
|
self::Pending => 'warning',
|
|
self::Resolved => 'success',
|
|
self::Ignored => 'gray',
|
|
};
|
|
}
|
|
|
|
/** @return array<string, string> */
|
|
public static function options(): array
|
|
{
|
|
return collect(self::cases())
|
|
->mapWithKeys(fn (self $case) => [$case->value => $case->getLabel()])
|
|
->all();
|
|
}
|
|
}
|