- $webhooks = Webhook::query()
- ->orderBy('name', 'desc')
- ->with('trackedEvents')
- ->get();
+ $listOptions = SimpleListOptions::fromRequest($request, 'webhooks')->withSortOptions([
+ 'name' => trans('common.sort_name'),
+ 'endpoint' => trans('settings.webhooks_endpoint'),
+ 'created_at' => trans('common.sort_created_at'),
+ 'updated_at' => trans('common.sort_updated_at'),
+ 'active' => trans('common.status'),
+ ]);
+
+ $webhooks = (new WebhooksAllPaginatedAndSorted())->run(20, $listOptions);
+ $webhooks->appends($listOptions->getPaginationAppends());
+
+ $this->setPageTitle(trans('settings.webhooks'));