Add patient SMS/email messaging and fix Meet video visit errors.
Deploy Ladill Care / deploy (push) Successful in 43s

Wire Care to Ladill SMS and Bird management APIs on the patient page, and surface Meet auth/config failures as friendly validation errors instead of a 502 page.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
isaacclad
2026-07-12 14:14:14 +00:00
co-authored by Cursor
parent 0bb19233e2
commit 2568b8a2f0
12 changed files with 505 additions and 2 deletions
@@ -134,6 +134,36 @@
</div>
<div class="space-y-6">
@if ($canManage)
<section class="rounded-2xl border border-slate-200 bg-white p-6" x-data="{ tab: 'sms' }">
<h2 class="text-sm font-semibold uppercase tracking-wide text-slate-500">Message patient</h2>
<p class="mt-1 text-xs text-slate-500">SMS uses Ladill SMS credits. Email uses Ladill Bird credits.</p>
<div class="mt-4 flex gap-1 rounded-xl bg-slate-100 p-1 text-sm">
<button type="button" @click="tab = 'sms'" :class="tab === 'sms' ? 'bg-white shadow-sm text-slate-900' : 'text-slate-500'" class="flex-1 rounded-lg px-3 py-1.5 font-medium">SMS</button>
<button type="button" @click="tab = 'email'" :class="tab === 'email' ? 'bg-white shadow-sm text-slate-900' : 'text-slate-500'" class="flex-1 rounded-lg px-3 py-1.5 font-medium">Email</button>
</div>
<form x-show="tab === 'sms'" x-cloak method="POST" action="{{ route('care.patients.sms', $patient) }}" class="mt-4 space-y-3">
@csrf
<p class="text-xs text-slate-500">To: {{ $patient->phone ?: 'no phone on file' }}</p>
<textarea name="message" rows="3" maxlength="480" placeholder="Text message" required class="block w-full rounded-xl border-slate-300 text-sm focus:border-sky-500 focus:ring-sky-500">{{ old('message') }}</textarea>
<div class="text-right">
<button type="submit" class="btn-primary" @if(! $patient->phone) disabled @endif>Send SMS</button>
</div>
</form>
<form x-show="tab === 'email'" x-cloak method="POST" action="{{ route('care.patients.email', $patient) }}" class="mt-4 space-y-3">
@csrf
<p class="text-xs text-slate-500">To: {{ $patient->email ?: 'no email on file' }}</p>
<input type="text" name="subject" value="{{ old('subject') }}" placeholder="Subject" required class="block w-full rounded-xl border-slate-300 text-sm focus:border-sky-500 focus:ring-sky-500">
<textarea name="body" rows="4" placeholder="Message" required class="block w-full rounded-xl border-slate-300 text-sm focus:border-sky-500 focus:ring-sky-500">{{ old('body') }}</textarea>
<div class="text-right">
<button type="submit" class="btn-primary" @if(! $patient->email) disabled @endif>Send email</button>
</div>
</form>
</section>
@endif
<section class="rounded-2xl border border-slate-200 bg-white p-6">
<h2 class="text-sm font-semibold uppercase tracking-wide text-slate-500">Emergency contacts</h2>
@forelse ($patient->emergencyContacts as $contact)