Implement webhook inspector
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\WebhookEndpoint;
|
||||
use Illuminate\Support\Facades\Gate;
|
||||
use Illuminate\View\View;
|
||||
|
||||
class InspectorController extends Controller
|
||||
{
|
||||
public function show(string $token): View
|
||||
{
|
||||
$endpoint = WebhookEndpoint::findByToken($token);
|
||||
|
||||
abort_unless($endpoint instanceof WebhookEndpoint && $endpoint->acceptsRequests(), 404);
|
||||
Gate::authorize('view', $endpoint);
|
||||
|
||||
return view('inspector-page', ['endpoint' => $endpoint]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user