buttons work now after style tags removed

This commit is contained in:
spencerrlongg 2023-12-05 16:41:25 -06:00
parent d3967b37cd
commit 080d196138
3 changed files with 179 additions and 192 deletions

View file

@ -2,7 +2,7 @@
namespace App\Http\Livewire; namespace App\Http\Livewire;
use Illuminate\Support\Facades\Auth; use Laravel\Passport\Client;
use Laravel\Passport\ClientRepository; use Laravel\Passport\ClientRepository;
use Livewire\Component; use Livewire\Component;
@ -29,11 +29,12 @@ class OauthClients extends Component
//$newClient = ; //$newClient = ;
$this->dispatchBrowserEvent('clientCreated', $newClient->accessToken); //$this->dispatchBrowserEvent('clientCreated', $newClient->accessToken);
} }
public function deleteClient($clientId): void public function deleteClient(Client $clientId): void
{ {
Auth::user()->clients()->find($clientId)->delete(); //->delete must be of type Client - thus the model binding
app(ClientRepository::class)->delete($clientId);
} }
} }

View file

@ -1,15 +1,4 @@
<style scoped> <div>
.action-link {
cursor: pointer;
}
.m-b-none {
margin-bottom: 0;
}
</style>
<template>
<div>
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading"> <div class="panel-heading">
<div style="display: flex; justify-content: space-between; align-items: center;"> <div style="display: flex; justify-content: space-between; align-items: center;">
@ -34,9 +23,7 @@
@endif @endif
@if($clients->count() > 0) @if($clients->count() > 0)
<table class="table table-borderless m-b-none" <table class="table table-borderless m-b-none">
{{-- v-if="clients.length > 0"--}}
>
<thead> <thead>
<tr> <tr>
<th>Client ID</th> <th>Client ID</th>
@ -49,8 +36,7 @@
<tbody> <tbody>
@foreach($clients as $client) @foreach($clients as $client)
<tr <tr>
>
<!-- ID --> <!-- ID -->
<td style="vertical-align: middle;"> <td style="vertical-align: middle;">
{{ $client->id }} {{ $client->id }}
@ -76,11 +62,9 @@
</td> </td>
<!-- Delete Button --> <!-- Delete Button -->
<td style="vertical-align: middle;"> <td style="vertical-align: middle;" class="text-right">
<a class="action-link btn btn-danger btn-sm" <a class="action-link btn btn-danger btn-sm" wire:click="deleteClient('{{ $client->id }}')">
wire:click="deleteClient('{{ $client->id }}')" <i class="fas fa-trash"></i>
>
Delete
</a> </a>
</td> </td>
</tr> </tr>
@ -174,7 +158,7 @@
<div class="modal-dialog"> <div class="modal-dialog">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<button type="button " class="close" data-dismiss="modal" aria-hidden="true">&times;</button> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h4 class="modal-title"> <h4 class="modal-title">
Edit Client Edit Client
@ -246,5 +230,7 @@
</div> </div>
</div> </div>
</div> </div>
</div> <script>
</template>
</script>
</div>

View file

@ -15,7 +15,7 @@
@if (!config('app.lock_passwords')) @if (!config('app.lock_passwords'))
<div id="app"> <div id="app">
<livewire:oauth-clients /> <livewire:oauth-clients />
<passport-clients clients-url="{{ url('oauth/clients') }}"></passport-clients> {{-- <passport-clients clients-url="{{ url('oauth/clients') }}"></passport-clients>--}}
<passport-authorized-clients clients-url="{{ url('oauth/clients') }}" tokens-url="{{ url('oauth/tokens') }}"></passport-authorized-clients> <passport-authorized-clients clients-url="{{ url('oauth/clients') }}" tokens-url="{{ url('oauth/tokens') }}"></passport-authorized-clients>
</div> </div>
@else @else