Disable Toggle Column by button

i have toggle column and i want to if i click the button click it will disable the toggle column, i have to tried to make function with button on livewire but its not working, this my code
this my function to handle click
public function lockdataTable()
{
$this->lockdata = !$this->lockdata;
}

this my code of the toggle column
ToggleColumn::make('mengajukan_rpl')->label('Mengajukan RPL')->disabled($this->lockdata),

i havent idea again, maybe someone can help me for fix my isue, thanks
Solution
i have toggle column and i want to if i click the button click it will disable the toggle column, i have to tried to make function with button on livewire but its not working, this my code
this my function to handle click
public function lockdataTable()
{
$this->lockdata = !$this->lockdata;
}

this my code of the toggle column
ToggleColumn::make('mengajukan_rpl')->label('Mengajukan RPL')->disabled($this->lockdata),

i havent idea again, maybe someone can help me for fix my isue, thanks
Was this page helpful?