aleksandro-del-piero / livewire-locked-properties
Livewire locked properties
Installs: 4
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/aleksandro-del-piero/livewire-locked-properties
Requires (Dev)
- orchestra/testbench: ^8.0
- phpunit/phpunit: ^10.5
This package is auto-updated.
Last update: 2025-10-12 04:15:42 UTC
README
The package allows you to designate component properties as locked.
Tested package on Livewire v2.12.6
Installation
You can install the package via composer:
composer require aleksandro_del_piero/livewire-locked-properties
Documentation
You need to add a trait to the component AleksandroDelPiero\LivewireLockedProperties\Traits\WithLockedLivewire;
To designate a property as protected, you must add it to a protected property $locked or declare a method locked().
namespace App\Http\Livewire;
use Livewire\Component;
use AleksandroDelPiero\LivewireLockedProperties\Traits\WithLockedLivewire;
class TestLivewire extends Component
{
use WithLockedLivewire;
public $name;
protected $locked = [
'name'
];
...
or a protected method 'locked'
namespace App\Http\Livewire; use Livewire\Component; use AleksandroDelPiero\LivewireLockedProperties\Traits\WithLockedLivewire; class TestLivewire extends Component { use WithLockedLivewire; public $name; protected function locked(): array { return ['name']; } ...
If a component has both a method and a property, the method will take precedence.
License
The MIT License (MIT). Please see License.md for more information.