forge/app/Livewire/Mod/ModerationOptions.php

30 lines
560 B
PHP
Raw Normal View History

2024-10-08 13:15:12 -04:00
<?php
namespace App\Livewire\Mod;
2024-11-23 11:27:10 -05:00
use App\Models\Mod;
2024-10-08 13:15:12 -04:00
use Livewire\Component;
class ModerationOptions extends Component
{
2024-11-23 11:27:10 -05:00
public Mod $mod;
2024-10-08 13:15:12 -04:00
public function render()
{
return view('livewire.mod.moderation-options');
2024-10-08 13:15:12 -04:00
}
2024-11-22 14:28:13 -05:00
public function deleteMod(): void
{
2024-11-23 11:27:10 -05:00
$this->mod->delete();
$this->js('window.location.reload()');
2024-11-22 14:28:13 -05:00
}
public function toggleDisabled(): void
2024-11-22 14:28:13 -05:00
{
$this->mod->disabled = ! $this->mod->disabled;
2024-11-23 11:27:10 -05:00
$this->mod->save();
$this->js('window.location.reload()');
2024-11-22 14:28:13 -05:00
}
2024-10-08 13:15:12 -04:00
}