*/ public static function statusValues(): array { return [ null => '-', self::PENDING => __('Pending'), self::REGISTER => __('Registered'), self::PROCESSING => __('Processing'), self::COMPLETED => __('Completed'), self::CANCELLED => __('Cancelled'), ]; } /** * Tailwind * * @return array */ public static function statusClasses(): array { return [ null => '-', self::PENDING => 'warning', self::REGISTER => 'info', self::PROCESSING => 'info', self::COMPLETED => 'success', self::CANCELLED => 'danger', ]; } /** * Status icons * * @return array */ public static function statusIcons(): array { return [ null => '-', 'success' => 'check-circle', 'info' => 'information-circle', 'primary' => 'clipboard-list', 'danger' => 'ban', 'warning' => 'exclamation-circle', ]; } /** * Status color matching */ public static function statusColorMatching(): Closure { return fn (string $state): string => match ($state) { self::PENDING => 'warning', self::REGISTER => 'info', self::PROCESSING => 'primary', self::COMPLETED => 'success', self::CANCELLED => 'danger', default => 'primary', }; } /** * Formatted status for given "status" */ public static function statusFormatted(string $status = 'pending'): string { return static::statusValues()[$status] ?? __('None'); } }