all()); $expected = (string) config('services.moneybird.webhook_token'); $received = (string) $request->input('webhook_token', ''); if (blank($expected) || blank($received) || ! hash_equals($expected, $received)) { abort(403); } $entityType = $request->input('entity_type'); $entityId = $request->input('entity_id'); if ($entityType === 'SalesInvoice' && filled($entityId)) { $subscriptions->handleSalesInvoiceEvent((string) $entityId); } return response()->noContent(); } }