awcodes / filament-tiptap-editor

A Rich Text Editor plugin for Filament Forms.
MIT License
249 stars 64 forks source link

Allow blocks method to accept closure #403

Closed dmason30 closed 3 weeks ago

dmason30 commented 3 weeks ago

Adds closure support to ->blocks():

->blocks(function (Forms\Get $get): array {
    /** @var EmailTemplateType | string $type */
    $type = $get('type');

    return EmailTemplateType::parse($type)->getBlocks();
})