janecodelife/livewire-secure-properties

Automatically lock Livewire properties from client-side modification unless explicitly unlocked with zero configs.
17 2
Install
composer require janecodelife/livewire-secure-properties
Latest Version:v1.0.1
Laravel:10 – 13
License:MIT
Last Updated:Oct 22, 2026
Links: GitHub  ·  Packagist
Maintainer: janecodelife

Livewire Secure Properties 🔒

License: MIT Sponsor on GitHub

An elegant, zero-configuration security package for Laravel Livewire 4 that automatically locks all public component properties from client-side manipulation, unless explicitly marked as unlocked.

✅ Auto-lock properties

✅ Zero configuration

✅ Protects against client-side tampering

✅ Unlock specific properties with #[Unlocked]

✅ Supports Livewire 4 (Single & Multiple File)


Requirements

  • Livewire ^4.0

Installation

You can install the package via composer:

composer require janecodelife/livewire-secure-properties

Usage

1. Single File Components (SFC)

If you are using Livewire 4's native Single File Components layout, you can safely use the #[Unlocked] attribute inside the anonymous class block:

<?php

use Livewire\Component;
use JaneCodeLife\LivewireSecureProperties\Unlocked;

new class extends Component {
    // ✅ Secured: Locked by default, any client-side update will throw a Security Violation exception
    public string $role = 'admin';

    // 🔓 UNLOCKED: Updatable from client side via wire:model or client-side requests
    #[Unlocked]
    public string $name = 'Jane Joe';
};
?>

<div>
    <input type="text" wire:model.live="name">
    <p>Name: {{ $name }}</p>
    <!-- This would securely block any client-side update attempts -->
    <input type="text" wire:model.live="role">
    <p>Role: {{ $role }}</p>
</div>

2. Multiple File Components (Class-based)

use Livewire\Component;
use JaneCodeLife\LivewireSecureProperties\Unlocked;

class UserProfile extends Component
{
    // ✅ Secured: Locked by default, any client-side update will throw a Security Violation exception
    public string $role = 'admin';

    // 🔓 UNLOCKED: Updatable from client side via wire:model or client-side requests
    #[Unlocked]
    public string $name = 'Jane Joe';

    public function render()
    {
        return view('livewire.user-profile');
    }
}

Video 📺

Livewire Secure Properties Video

Configuration

If you need to disable the package globally during specific environments (e.g., local debugging), you can add this environment variable to your .env file:

LIVEWIRE_SECURE_PROPERTIES_ENABLED=false

Security Violations

When a locked property is violated, the package throws a PropertyLockedException with a 403 status code, making it easy to intercept globally or monitor via your error loggers.


💝🤟 Support the Project 🤟💝

Become a Sponsor on GitHub

Every bit of support fuels the expansion of this ecosystem and helps me write cleaner tools for all of us. Thank you for standing behind independent developers!_ 🙏🤟


💝🤟 A huge thank you to our sponsors! 💝🤟


🔗 My Other Plugins

Check out my other open-source tools to supercharge your Neovim environment:


If Have A Question 🤝 (Contact Me) 🤟

I will be there to answer to all messages

Follow on X Subscribe on YouTube


Upcoming 🚀 (Stay Tuned!)

The Ultimate Neovim Config for All Modern Web & Laravel Devs ⚡

Thank You

Related Packages

twstec/starter-livewire

TWS Laravel Starter Kit — starter Livewire: aplicativo Laravel 13 completo (pain...

5 0
niladam/livewire-ban

Automatically ban IP addresses that trigger Livewire exceptions no legitimate br...

2,042 4
christhompsontldr/fluxui-devices

FluxUI front-end for managing devices and sessions using diego-ninja/laravel-dev...

536 0
agenticmorf/fluxui-devices

FluxUI front-end for managing devices and sessions using diego-ninja/laravel-dev...

106 0
elvisblanco1993/livewire-v4-recaptcha

Add Google reCAPTCHA (v3, v2, invisible) support to Laravel Livewire v4 componen...

82 0

Version History

Version Released License
v1.0.1 MIT