Files
panel/app/Livewire/AlertBannerCollection.php

18 lines
555 B
PHP
Raw Permalink Normal View History

2026-02-15 15:34:09 -05:00
<?php
namespace App\Livewire;
use Filament\Notifications\Collection;
2026-07-11 15:58:44 -04:00
use Illuminate\Contracts\Support\Htmlable;
2026-02-15 15:34:09 -05:00
class AlertBannerCollection extends Collection
{
public static function fromLivewire($value): static
{
2026-07-11 15:58:44 -04:00
return (new static($value))->transform(function (array $alertBanner): AlertBanner {
/** @var array{id: string, title: ?string, body: ?string, status: ?string, icon: string|\BackedEnum|Htmlable|null, closeable: bool} $alertBanner */
return AlertBanner::fromArray($alertBanner);
});
2026-02-15 15:34:09 -05:00
}
}