-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
♻️ rewrite webhook settings in vue; api improvements
- Loading branch information
1 parent
f73ae81
commit 1870405
Showing
13 changed files
with
163 additions
and
159 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
namespace App\Http\Resources; | ||
|
||
use App\Enum\WebhookEvent; | ||
use Illuminate\Http\Request; | ||
use Illuminate\Http\Resources\Json\JsonResource; | ||
|
||
class WebhookEventResource extends JsonResource | ||
{ | ||
/** | ||
* Transform the resource into an array. | ||
* | ||
* @param Request $request | ||
* | ||
* @return array | ||
*/ | ||
public function toArray($request): array { | ||
return [ | ||
'type' => $this->event->value, | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,8 @@ | ||
@php | ||
use Carbon\Carbon; | ||
use App\Enum\WebhookEvent; | ||
@endphp | ||
@extends('layouts.settings') | ||
@section('title', __('settings.title-webhooks')) | ||
|
||
@section('content') | ||
<div class="row justify-content-center"> | ||
<div class="col-md-8 col-lg-7"> | ||
<div class="card mb-3"> | ||
<div class="card-header">{{ __('settings.title-webhooks') }}</div> | ||
<div class="card-body table-responsive px-0"> | ||
<p class="mx-4"> | ||
{{ __('settings.webhook-description') }} | ||
</p> | ||
@if(count($webhooks) == 0) | ||
<p class="text-danger mx-4">{{__('settings.no-webhooks')}}</p> | ||
@else | ||
<table class="table"> | ||
<thead> | ||
<tr> | ||
<th>{{ __('settings.client-name') }}</th> | ||
<th>{{ __('settings.created') }}</th> | ||
<th>{{ __('settings.webhook-event-notifications-description') }}</th> | ||
<th></th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
@foreach($webhooks as $webhook) | ||
<tr> | ||
<td>{{ $webhook->client->name }}</td> | ||
<td>{{ Carbon::parse($webhook->created_at)->isoFormat(__('datetime-format')) }}</td> | ||
<td> | ||
<ul> | ||
@foreach($webhook->events()->get() as $event) | ||
<li>{{ __('settings.webhook_event.' . $event->event->value) }}</li> | ||
@endforeach | ||
</ul> | ||
</td> | ||
<td> | ||
<form method="post" action="{{ route('delwebhook') }}"> | ||
@csrf | ||
<input type="hidden" name="webhookId" value="{{$webhook->id}}"/> | ||
<button class="btn btn-block btn-danger mx-0"> | ||
<i class="fas fa-trash"></i> | ||
</button> | ||
</form> | ||
</td> | ||
</tr> | ||
@endforeach | ||
</tbody> | ||
</table> | ||
@endif | ||
</div> | ||
</div> | ||
</div> | ||
<div id="settings-webhooks"> | ||
<Webhooks></Webhooks> | ||
</div> | ||
@endsection |
Oops, something went wrong.