Add option to delete webhooks.

This commit is contained in:
James Cole
2022-09-18 05:49:56 +02:00
parent 625ad14d7d
commit d9245f06f7
58 changed files with 768 additions and 43 deletions
+25
View File
@@ -40,6 +40,7 @@ use FireflyIII\Models\TransactionCurrency;
use FireflyIII\Models\TransactionGroup;
use FireflyIII\Models\TransactionJournal;
use FireflyIII\Models\TransactionJournalLink;
use FireflyIII\Models\Webhook;
use FireflyIII\User;
use Illuminate\Support\Arr;
@@ -1244,6 +1245,30 @@ try {
}
);
Breadcrumbs::for(
'webhooks.show',
static function (Generator $breadcrumbs, Webhook $webhook) {
$breadcrumbs->parent('webhooks.index');
$breadcrumbs->push(limitStringLength($webhook->title), route('webhooks.show', [$webhook->id]));
}
);
Breadcrumbs::for(
'webhooks.delete',
static function (Generator $breadcrumbs, Webhook $webhook) {
$breadcrumbs->parent('webhooks.show', $webhook);
$breadcrumbs->push(trans('firefly.delete_webhook', ['title' => limitStringLength($webhook->title)]), route('webhooks.delete', [$webhook->id]));
}
);
Breadcrumbs::for(
'webhooks.edit',
static function (Generator $breadcrumbs, Webhook $webhook) {
$breadcrumbs->parent('webhooks.show', $webhook);
$breadcrumbs->push(trans('firefly.edit_webhook', ['title' => limitStringLength($webhook->title)]), route('webhooks.edit', [$webhook->id]));
}
);
} catch (DuplicateBreadcrumbException $e) {
// @ignoreException
}
+3
View File
@@ -1092,6 +1092,9 @@ Route::group(
static function () {
Route::get('index', ['uses' => 'IndexController@index', 'as' => 'index']);
Route::get('create', ['uses' => 'CreateController@index', 'as' => 'create']);
Route::get('edit/{webhook}', ['uses' => 'EditController@index', 'as' => 'edit']);
Route::get('delete/{webhook}', ['uses' => 'DeleteController@index', 'as' => 'delete']);
Route::get('show/{webhook}', ['uses' => 'ShowController@index', 'as' => 'show']);
}
);