diff --git a/app/Http/Livewire/PersonalAccessTokens.php b/app/Http/Livewire/PersonalAccessTokens.php
new file mode 100644
index 0000000000..c9e30a9430
--- /dev/null
+++ b/app/Http/Livewire/PersonalAccessTokens.php
@@ -0,0 +1,40 @@
+ Auth::user()->tokens,
+ ]);
+ }
+
+ public function rules(): array
+ {
+ return [
+ 'name' => 'required',
+ 'scopes' => 'nullable|array',
+ ];
+ }
+
+ public function createToken(): void
+ {
+ Auth::user()->createToken($this->name, $this->scopes);
+ }
+
+ public function deleteToken($tokenId): void
+ {
+ Auth::user()->tokens()->where('id', $tokenId)->delete();
+ }
+
+ public function getTokensProperty(): array
+ {
+ return Auth::user()->tokens;
+ }
+}
diff --git a/resources/views/account/api.blade.php b/resources/views/account/api.blade.php
index 2e97c99748..8098ea7e35 100644
--- a/resources/views/account/api.blade.php
+++ b/resources/views/account/api.blade.php
@@ -18,8 +18,10 @@
{{-- token-url="{{ url('oauth/personal-access-tokens') }}"--}}
{{-- scopes-url="{{ url('oauth/scopes') }}">--}}
{{-- --}}
- {{-- New Component --}}
-
{{ trans('general.feature_disabled') }}
@endif diff --git a/resources/views/livewire/personal-access-tokens.blade.php b/resources/views/livewire/personal-access-tokens.blade.php new file mode 100644 index 0000000000..6f8fcaeb78 --- /dev/null +++ b/resources/views/livewire/personal-access-tokens.blade.php @@ -0,0 +1,85 @@ +@props([ + 'token_url' => url('oauth/personal-access-tokens'), + 'scopes_url' => url('oauth/scopes'), +]) + +New Personal Access Token Component
+{{ $token_url }}
+{{ $scopes_url }}
++ You have not created any personal access tokens. +
+ @endif + + +Name | +Created | +Expires | +Delete | +
---|---|---|---|
+ {{ $token->name }} + | + ++ {{ $token->created_at }} + | + ++ {{ $token->expires_at }} + | + + + ++ + + + | +