dvarilek/livewire-closure-synthesizer

A Closure Synthesizer for Laravel Livewire

v1.1.0 2025-04-19 09:50 UTC

This package is auto-updated.

Last update: 2025-04-20 17:04:54 UTC


README

This simple package adds a custom closure synthesizer for Laravel Livewire.

This essentially allows you to pass closures into livewire components and persist them as public properties across requests.

Closures are serialized and encrypted which ensures that a curious user does not know what the closure contains.

Installation

All you have to do is just run the following command:

composer require dvarilek/livewire-closure-synthesizer

Example Usage

In blade:

<livewire:component 
    :modifyComponentUsing="$modifyComponentUsing"
/>

In Livewire component

class Component extends \Livewire\Component
{
    
    public ?Closure $modifyComponentUsing = null;
    
    // ... 
}

Testing

composer test && composer stan

Changelog

Please refer to Package Releases for more information about changes.

License

This package is under the MIT License. Please refer to License File for more information