Faster voice announcements, Care/Frontdesk API, and console UI polish.
Deploy Ladill Queue / deploy (push) Successful in 28s
Deploy Ladill Queue / deploy (push) Successful in 28s
Poll displays every 1.2s with client-side TTS ack; expose service API for sibling apps; redesign tickets, counters, and staff console. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use App\Models\Organization;
|
||||
use Closure;
|
||||
use Illuminate\Http\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
|
||||
class EnsureQueueIntegration
|
||||
{
|
||||
public function handle(Request $request, Closure $next): Response
|
||||
{
|
||||
$caller = (string) $request->attributes->get('service_caller', '');
|
||||
if (! in_array($caller, ['care', 'frontdesk'], true)) {
|
||||
return $next($request);
|
||||
}
|
||||
|
||||
$owner = trim((string) ($request->input('owner') ?? $request->query('owner', '')));
|
||||
if ($owner === '') {
|
||||
return response()->json(['error' => 'The owner parameter is required.'], 422);
|
||||
}
|
||||
|
||||
$organization = Organization::owned($owner)->first();
|
||||
if (! $organization || ! data_get($organization->settings, 'integrations.'.$caller.'_enabled', false)) {
|
||||
return response()->json(['error' => 'Queue integration is not enabled for this account.'], 403);
|
||||
}
|
||||
|
||||
return $next($request);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user