<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Jane Code Life</title>
    <description>The latest articles on DEV Community by Jane Code Life (@janecodelife).</description>
    <link>https://dev.to/janecodelife</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4078259%2F0605412f-3a6b-4e08-a6d7-26520bb08e1a.png</url>
      <title>DEV Community: Jane Code Life</title>
      <link>https://dev.to/janecodelife</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/janecodelife"/>
    <language>en</language>
    <item>
      <title>How to Automatically Secure Your Livewire 4 Components From Client-Side Tampering</title>
      <dc:creator>Jane Code Life</dc:creator>
      <pubDate>Fri, 14 Aug 2026 23:01:51 +0000</pubDate>
      <link>https://dev.to/janecodelife/how-to-automatically-secure-your-livewire-4-components-from-client-side-tampering-5c77</link>
      <guid>https://dev.to/janecodelife/how-to-automatically-secure-your-livewire-4-components-from-client-side-tampering-5c77</guid>
      <description>&lt;h1&gt;
  
  
  Livewire Secure Properties 🔒
&lt;/h1&gt;

&lt;p&gt;👉 &lt;strong&gt;View on GitHub:&lt;/strong&gt; &lt;a href="https://github.com/janecodelife/livewire-secure-properties" rel="noopener noreferrer"&gt;janecodelife/livewire-secure-properties&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;✅ Auto-lock properties&lt;/p&gt;

&lt;p&gt;✅ Zero configuration&lt;/p&gt;

&lt;p&gt;✅ Protects against client-side tampering&lt;/p&gt;

&lt;p&gt;✅ Unlock specific properties with #[Unlocked]&lt;/p&gt;

&lt;p&gt;✅ Supports Livewire 4 (Single &amp;amp; Multiple File)&lt;/p&gt;

&lt;h2&gt;
  
  
  Requirements
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Livewire ^4.0&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Installation
&lt;/h2&gt;

&lt;p&gt;You can install the package via composer:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;composer require janecodelife/livewire-secure-properties
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Usage
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Single File Components (SFC)
&lt;/h3&gt;

&lt;p&gt;If you are using Livewire 4's native Single File Components layout, you can safely use the &lt;code&gt;#[Unlocked]&lt;/code&gt; attribute inside the anonymous class block:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;?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';
};
?&amp;gt;

&amp;lt;div&amp;gt;
    &amp;lt;input type="text" wire:model.live="name"&amp;gt;
    &amp;lt;p&amp;gt;Name: {{ $name }}&amp;lt;/p&amp;gt;
    &amp;lt;!-- This would securely block any client-side update attempts --&amp;gt;
    &amp;lt;input type="text" wire:model.live="role"&amp;gt;
    &amp;lt;p&amp;gt;Role: {{ $role }}&amp;lt;/p&amp;gt;
&amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2. Multiple File Components (Class-based)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;
&lt;span class="cp"&gt;&amp;lt;?php&lt;/span&gt;
&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;Livewire\Component&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;JaneCodeLife\LivewireSecureProperties\Unlocked&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;UserProfile&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nc"&gt;Component&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// ✅ Secured: Locked by default, any client-side update will throw a Security Violation exception&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="nv"&gt;$role&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'admin'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="c1"&gt;// 🔓 UNLOCKED: Updatable from client side via wire:model or client-side requests&lt;/span&gt;
    &lt;span class="na"&gt;#[Unlocked]&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="nv"&gt;$name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'Jane Joe'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;render&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;view&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'livewire.user-profile'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Configuration
&lt;/h2&gt;

&lt;p&gt;If you need to disable the package globally during specific environments (e.g., local debugging), you can add this environment variable to your &lt;code&gt;.env&lt;/code&gt; file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;LIVEWIRE_SECURE_PROPERTIES_ENABLED=false
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  💖 Support
&lt;/h2&gt;

&lt;h3&gt;
  
  
  ☕☕☕☕ Support me by coffee via USDT ☕☕☕☕
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Network:&lt;/strong&gt; &lt;code&gt;TRX Tron (TRC20)&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Address:&lt;/strong&gt; &lt;code&gt;TAFFjBP39Z86weL5dDU1A2251VrgPprDUj&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Upcoming 🚀 (Stay Tuned!)
&lt;/h2&gt;

&lt;h3&gt;
  
  
  The Ultimate Neovim Config for Modern Web &amp;amp; Laravel Devs ⚡
&lt;/h3&gt;

&lt;p&gt;I am currently cooking a comprehensive guide and boilerplate configuration on &lt;strong&gt;How to turn Neovim into a (Powerful) IDE&lt;/strong&gt; explicitly optimized for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Backend &amp;amp; Frameworks&lt;/strong&gt;: PHP (Intelephense) &amp;amp; Full Laravel &amp;amp; Livewire Integration (With Preformance)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Frontend &amp;amp; Tooling&lt;/strong&gt;: HTML, CSS, JavaScript, TypeScript, and Livewire SFCs&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Speed&lt;/strong&gt;: Blazing fast autocompletion, lightning-speed code navigation, and fuzzy finding.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>laravel</category>
      <category>livewire</category>
      <category>security</category>
      <category>php</category>
    </item>
  </channel>
</rss>
