dvarilek / livewire-closure-synthesizer
A Closure Synthesizer for Laravel Livewire
v1.1.0
2025-04-19 09:50 UTC
Requires
- laravel/serializable-closure: ^1.1.0 || ^2.0.0
- livewire/livewire: ^3.0
Requires (Dev)
- orchestra/testbench: ^10.2
- pestphp/pest: ^2.31 || ^3.0.0
- phpstan/phpstan: ^2.1
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