<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
janecodelife / livewire-secure-properties example snippets
public int $accountId = 45;
public int $formStep = 1;
public int $countryId; // ✅ Secured: Locked by default
public int $stateId; // ✅ Secured: Locked by default (Crucial!)
public int $cityId; // ✅ Secured: Locked by default
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';
};
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');
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.