Start throwing 404's

This commit is contained in:
James Cole
2023-12-29 08:35:54 +01:00
parent 7aa3aef508
commit 244ffb2450
5 changed files with 22 additions and 2 deletions

View File

@@ -29,6 +29,7 @@ use Illuminate\Contracts\Foundation\Application;
use Illuminate\Contracts\View\Factory;
use Illuminate\Contracts\View\View;
use Illuminate\Support\Facades\Log;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
/**
* Class DeleteController
@@ -60,9 +61,12 @@ class DeleteController extends Controller
*
* @return Application|Factory|View
*/
public function index(Webhook $webhook)
{
public function index(Webhook $webhook) {
Log::channel('audit')->info('User visits webhook delete page.');
if(false === config('firefly.allow_webhooks')) {
throw new NotFoundHttpException('Webhooks are not enabled.');
}
$subTitle = (string)trans('firefly.delete_webhook', ['title' => $webhook->title]);
$this->rememberPreviousUrl('webhooks.delete.url');