21 lines
510 B
PHP
21 lines
510 B
PHP
<?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]);
|
|
}
|
|
}
|