user(); // Gán giá trị bool từ database tinyInteger $this->email_marketing = (bool) $user->email_marketing; $this->receive_deposit = (bool) $user->receive_deposit; } public function updated($propertyName) { $user = auth('users')->user(); // Cập nhật database với giá trị int 0 hoặc 1 $user->update([ $propertyName => $this->$propertyName ? 1 : 0, ]); } public function render() { return view('livewire.user-settings', [ 'user' => auth('users')->user(), // Truyền user để hiển thị thông tin ]); } }