mirror of
https://github.com/pelican-dev/panel.git
synced 2026-07-16 14:03:58 +03:00
18 lines
555 B
PHP
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);
|
|
});
|
|
}
|
|
}
|