Skip to content

Nested reserialization issue #163

@ahmed-rashad-alnaggar

Description

@ahmed-rashad-alnaggar

Hi, thank you for this awesome package

I have a weird issue:

use Filament\Actions\Action;
use Filament\Notifications\Notification;
use Opis\Closure\Serializer;

$serialized = Serializer::serialize(Notification::make()
        ->title(static fn (): string => 'title' /*for example*/)
        ->danger()
        ->actions(fn () => [
            Action::make('monitor_logs')
                ->label(static fn (): string => 'label' /*for example*/)
                ->color('info')
                ->button()
                ->action(fn () => 1 /*for example*/)
        ]));

$unserialized =  Serializer::unserialize($serialized);

In the above code when the notification is unserialized everything works fine except for the notification's Action's action fn() => 1 it becomes the closure of the notification's actions' function fn() => [...] although the notification's Action's label is returned as expected?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions