29 lines
706 B
PHP
29 lines
706 B
PHP
<?php
|
|
|
|
namespace App\Livewire\Ui\System\Modal;
|
|
|
|
use App\Models\PersonalAccessToken;
|
|
use Illuminate\Support\Facades\Auth;
|
|
use LivewireUI\Modal\ModalComponent;
|
|
|
|
class ApiKeyScopesModal extends ModalComponent
|
|
{
|
|
public string $tokenName = '';
|
|
public array $scopes = [];
|
|
|
|
public function mount(int $tokenId): void
|
|
{
|
|
$token = PersonalAccessToken::where('tokenable_id', Auth::id())
|
|
->where('tokenable_type', Auth::user()::class)
|
|
->findOrFail($tokenId);
|
|
|
|
$this->tokenName = $token->name;
|
|
$this->scopes = $token->abilities;
|
|
}
|
|
|
|
public function render()
|
|
{
|
|
return view('livewire.ui.system.modal.api-key-scopes-modal');
|
|
}
|
|
}
|