Mpociot\CaptainHook\Http\WebhookController::update PHP Method

update() public method

Update the given webhook.
public update ( UpdateWebhookRequest $request, string $webhookId ) : Response
$request Mpociot\CaptainHook\Http\Requests\UpdateWebhookRequest
$webhookId string
return Response
    public function update(UpdateWebhookRequest $request, $webhookId)
    {
        $webhook = Webhook::where('tenant_id', $this->getTenantId($request))->where('id', $webhookId)->firstOrFail();
        $webhook->url = $request->url;
        $webhook->event = $request->event;
        $webhook->save();
    }