This commit is contained in:
Saeed Vaziry
2023-07-02 12:47:50 +02:00
commit 5c72f12490
825 changed files with 41659 additions and 0 deletions

View File

@ -0,0 +1,37 @@
<?php
namespace App\Http\Livewire\SshKeys;
use App\Models\SshKey;
use App\Traits\RefreshComponentOnBroadcast;
use Illuminate\Contracts\View\View;
use Livewire\Component;
class KeysList extends Component
{
use RefreshComponentOnBroadcast;
public int $deleteId;
protected $listeners = [
'$refresh',
];
public function delete(): void
{
$key = SshKey::query()->findOrFail($this->deleteId);
$key->delete();
$this->refreshComponent([]);
$this->dispatchBrowserEvent('confirmed', true);
}
public function render(): View
{
return view('livewire.ssh-keys.keys-list', [
'keys' => SshKey::query()->latest()->get(),
]);
}
}