Properties | Laravel Livewire

PHOTO EMBED

Mon May 27 2024 04:04:51 GMT+0000 (Coordinated Universal Time)

Saved by @tsesang

 1public $search = '';
 2public $isActive = true;
 3 
 4public function resetFilters()
 5{
 6    $this->reset('search');
 7    // Will only reset the search property.
 8 
 9    $this->reset(['search', 'isActive']);
10    // Will reset both the search AND the isActive property.
11 
12    $this->resetExcept('search');
13    // Will only reset the isActive property (any property but the search property).
14}
content_copyCOPY

https://laravel-livewire.com/docs/2.x/properties