mirror of
https://github.com/vitodeploy/vito.git
synced 2025-04-21 19:01:37 +00:00
32 lines
590 B
PHP
32 lines
590 B
PHP
<?php
|
|
|
|
namespace App\Http\Livewire\SshKeys;
|
|
|
|
use App\Actions\SshKey\CreateSshKey;
|
|
use Illuminate\Contracts\View\View;
|
|
use Livewire\Component;
|
|
|
|
class AddKey extends Component
|
|
{
|
|
public string $name;
|
|
|
|
public string $public_key;
|
|
|
|
public function add(): void
|
|
{
|
|
app(CreateSshKey::class)->create(
|
|
auth()->user(),
|
|
$this->all()
|
|
);
|
|
|
|
$this->emitTo(KeysList::class, '$refresh');
|
|
|
|
$this->dispatchBrowserEvent('added', true);
|
|
}
|
|
|
|
public function render(): View
|
|
{
|
|
return view('livewire.ssh-keys.add-key');
|
|
}
|
|
}
|