Files
panel/app/Livewire/AlertBannerCollection.php
2026-07-11 15:58:44 -04:00

18 lines
555 B
PHP

<?php
namespace App\Livewire;
use Filament\Notifications\Collection;
use Illuminate\Contracts\Support\Htmlable;
class AlertBannerCollection extends Collection
{
public static function fromLivewire($value): static
{
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);
});
}
}