Deploy Ladill Frontdesk / deploy (push) Successful in 33s
Use the organization logo from Settings when present, with the company name as fallback when no logo is uploaded. Co-authored-by: Cursor <cursoragent@cursor.com>
188 lines
12 KiB
PHP
188 lines
12 KiB
PHP
<x-app-layout title="Settings">
|
|
@php
|
|
$settings = $organization->settings ?? [];
|
|
@endphp
|
|
|
|
<h1 class="text-xl font-semibold text-slate-900">Settings</h1>
|
|
<p class="text-sm text-slate-500">{{ $organization->name }}</p>
|
|
|
|
@if ($canManage)
|
|
<section class="mt-6 max-w-2xl rounded-2xl border border-slate-200 bg-white p-5">
|
|
<div class="flex flex-wrap items-start justify-between gap-4">
|
|
<div>
|
|
<h2 class="text-sm font-semibold text-slate-900">Plan</h2>
|
|
<p class="mt-1 text-sm text-slate-600">
|
|
@if ($isPro)
|
|
<span class="font-medium text-indigo-700">{{ $plan['label'] ?? 'Pro' }}</span> — unlimited branches & kiosks, integrations, and unlimited host emails (SMS still billed per segment).
|
|
@else
|
|
<span class="font-medium">Free</span> — 1 branch, 1 kiosk, core check-in & badges. Host alerts billed after {{ number_format($freeEmailAllowance) }} free emails/month.
|
|
@endif
|
|
</p>
|
|
</div>
|
|
@if (! $isPro)
|
|
<a href="{{ route('frontdesk.pro.index') }}" class="btn-primary text-sm">Upgrade to Pro (GHS {{ number_format($proPriceMinor / 100, 0) }}/mo)</a>
|
|
@endif
|
|
</div>
|
|
<dl class="mt-4 grid gap-3 text-sm sm:grid-cols-2">
|
|
<div>
|
|
<dt class="text-slate-500">Host emails this month</dt>
|
|
<dd class="font-medium">
|
|
@if ($freeEmailAllowance === null)
|
|
{{ number_format($monthlyUsage->email_count) }} sent (unlimited on Pro)
|
|
@else
|
|
{{ number_format($monthlyUsage->email_count) }} / {{ number_format($freeEmailAllowance) }} free
|
|
@endif
|
|
</dd>
|
|
</div>
|
|
<div>
|
|
<dt class="text-slate-500">Host SMS this month</dt>
|
|
<dd class="font-medium">{{ number_format($monthlyUsage->sms_count) }} sent</dd>
|
|
</div>
|
|
</dl>
|
|
<p class="mt-3 text-xs text-slate-500">
|
|
Email {{ $emailCostFormatted }} each after free allowance · SMS from {{ $smsCostFormatted }} per segment — charged to your
|
|
<a href="{{ route('frontdesk.wallet') }}" class="text-indigo-600 underline">Ladill wallet</a>.
|
|
Hosts are notified via email or phone on their profile; linking a Ladill account is optional (in-app bell only).
|
|
</p>
|
|
</section>
|
|
@endif
|
|
|
|
<form method="POST" action="{{ route('frontdesk.settings.update') }}" enctype="multipart/form-data" class="mt-6 max-w-2xl space-y-6">
|
|
@csrf @method('PUT')
|
|
|
|
<section class="rounded-2xl border border-slate-200 bg-white p-5 space-y-4">
|
|
<h2 class="text-sm font-semibold text-slate-900">Organization</h2>
|
|
@if ($canManage)
|
|
<div>
|
|
<label class="block text-sm font-medium text-slate-700">Name</label>
|
|
<input type="text" name="name" value="{{ old('name', $organization->name) }}" required class="mt-1 w-full rounded-lg border-slate-300 text-sm">
|
|
</div>
|
|
<div>
|
|
<label class="block text-sm font-medium text-slate-700">Timezone</label>
|
|
<select name="timezone" class="mt-1 w-full rounded-lg border-slate-300 text-sm">
|
|
@foreach (timezone_identifiers_list() as $tz)
|
|
<option value="{{ $tz }}" @selected(old('timezone', $organization->timezone) === $tz)>{{ $tz }}</option>
|
|
@endforeach
|
|
</select>
|
|
</div>
|
|
<div>
|
|
<label class="block text-sm font-medium text-slate-700">Company logo</label>
|
|
<p class="mt-1 text-xs text-slate-500">Shown on the visitor kiosk and employee badges. PNG, JPG, WebP, or SVG up to 2 MB.</p>
|
|
@if (\App\Support\OrganizationBranding::hasCustomLogo($organization))
|
|
<img src="{{ \App\Support\OrganizationBranding::logoUrl($organization) }}"
|
|
alt="{{ $organization->name }}"
|
|
class="mt-3 h-12 w-auto max-w-xs rounded-lg border border-slate-200 bg-white object-contain p-2">
|
|
<label class="mt-3 flex items-center gap-2 text-sm text-slate-600">
|
|
<input type="checkbox" name="remove_logo" value="1" @checked(old('remove_logo'))>
|
|
Remove custom logo
|
|
</label>
|
|
@endif
|
|
<input type="file" name="logo" accept="image/png,image/jpeg,image/webp,image/svg+xml"
|
|
class="mt-3 block w-full text-sm text-slate-600 file:mr-3 file:rounded-lg file:border-0 file:bg-indigo-50 file:px-3 file:py-2 file:text-sm file:font-medium file:text-indigo-700">
|
|
</div>
|
|
@else
|
|
<dl class="text-sm space-y-2">
|
|
<div class="flex justify-between"><dt class="text-slate-500">Name</dt><dd>{{ $organization->name }}</dd></div>
|
|
<div class="flex justify-between"><dt class="text-slate-500">Timezone</dt><dd>{{ $organization->timezone }}</dd></div>
|
|
</dl>
|
|
@endif
|
|
</section>
|
|
|
|
@if ($canManage)
|
|
<section class="rounded-2xl border border-slate-200 bg-white p-5 space-y-4">
|
|
<h2 class="text-sm font-semibold text-slate-900">Reception & kiosk</h2>
|
|
<div class="grid gap-4 sm:grid-cols-2">
|
|
<div>
|
|
<label class="block text-sm font-medium text-slate-700">Badge expiry (hours)</label>
|
|
<input type="number" name="badge_expiry_hours" value="{{ old('badge_expiry_hours', $settings['badge_expiry_hours'] ?? 8) }}" min="1" max="24" class="mt-1 w-full rounded-lg border-slate-300 text-sm">
|
|
</div>
|
|
<div>
|
|
<label class="block text-sm font-medium text-slate-700">Kiosk inactivity reset (seconds)</label>
|
|
<input type="number" name="kiosk_reset_seconds" value="{{ old('kiosk_reset_seconds', $settings['kiosk_reset_seconds'] ?? 120) }}" min="30" max="600" class="mt-1 w-full rounded-lg border-slate-300 text-sm">
|
|
</div>
|
|
<div>
|
|
<label class="block text-sm font-medium text-slate-700">Contractor badge expiry (hours)</label>
|
|
<input type="number" name="contractor_badge_expiry_hours" value="{{ old('contractor_badge_expiry_hours', data_get($settings, 'type_badge_expiry_hours.contractor', 12)) }}" min="1" max="24" class="mt-1 w-full rounded-lg border-slate-300 text-sm">
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<label class="block text-sm font-medium text-slate-700">Visitor policy</label>
|
|
<textarea name="visitor_policy" rows="4" class="mt-1 w-full rounded-lg border-slate-300 text-sm">{{ old('visitor_policy', $settings['visitor_policy'] ?? '') }}</textarea>
|
|
</div>
|
|
<label class="flex items-center gap-2 text-sm">
|
|
<input type="checkbox" name="employee_kiosk_enabled" value="1"
|
|
@checked(old('employee_kiosk_enabled', $settings['employee_kiosk_enabled'] ?? true))>
|
|
Enable employee sign-in on kiosk (code + PIN)
|
|
</label>
|
|
<div>
|
|
<p class="text-sm font-medium text-slate-700">Notification channels</p>
|
|
<p class="mt-1 text-xs text-slate-500">Alerts go to each host's email and/or phone — no Ladill account required.</p>
|
|
<div class="mt-2 flex flex-wrap gap-3">
|
|
@foreach ($notificationChannels as $key => $label)
|
|
<label class="flex items-center gap-2 text-sm">
|
|
<input type="checkbox" name="notification_channels[]" value="{{ $key }}"
|
|
@checked(in_array($key, old('notification_channels', $settings['notification_channels'] ?? ['email'])))>
|
|
{{ $label }}
|
|
</label>
|
|
@endforeach
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<p class="text-sm font-medium text-slate-700">Notification events</p>
|
|
<div class="mt-2 grid gap-2 sm:grid-cols-2">
|
|
@foreach ($notificationEvents as $key => $label)
|
|
<label class="flex items-center gap-2 text-sm">
|
|
<input type="checkbox" name="notification_events[{{ $key }}]" value="1"
|
|
@checked(old("notification_events.{$key}", data_get($settings, "notification_events.{$key}", true)))>
|
|
{{ $label }}
|
|
</label>
|
|
@endforeach
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<label class="block text-sm font-medium text-slate-700">Daily report recipients</label>
|
|
<input type="text" name="report_daily_recipients" value="{{ old('report_daily_recipients', implode(', ', $settings['report_daily_recipients'] ?? [])) }}" placeholder="admin@example.com, security@example.com" class="mt-1 w-full rounded-lg border-slate-300 text-sm">
|
|
<p class="mt-1 text-xs text-slate-500">Comma-separated emails for the daily summary report.</p>
|
|
</div>
|
|
</section>
|
|
|
|
<button type="submit" class="btn-primary">Save settings</button>
|
|
@endif
|
|
</form>
|
|
|
|
<div class="mt-8 grid gap-4 lg:grid-cols-3">
|
|
@if ($canManage)
|
|
<a href="{{ route('frontdesk.branches.index') }}" class="rounded-2xl border border-slate-200 bg-white p-5 hover:border-indigo-300">
|
|
<h3 class="font-semibold text-slate-900">Branches</h3>
|
|
<p class="mt-1 text-sm text-slate-500">{{ $branchCount }} branch{{ $branchCount === 1 ? '' : 'es' }}</p>
|
|
</a>
|
|
<a href="{{ route('frontdesk.members.index') }}" class="rounded-2xl border border-slate-200 bg-white p-5 hover:border-indigo-300">
|
|
<h3 class="font-semibold text-slate-900">Team members</h3>
|
|
<p class="mt-1 text-sm text-slate-500">Manage roles and access</p>
|
|
</a>
|
|
@endif
|
|
<a href="{{ route('frontdesk.kiosk') }}" class="rounded-2xl border border-slate-200 bg-white p-5 hover:border-indigo-300">
|
|
<h3 class="font-semibold text-slate-900">Kiosk mode</h3>
|
|
<p class="mt-1 text-sm text-slate-500">Open self-service check-in</p>
|
|
</a>
|
|
@if ($canManage)
|
|
<a href="{{ route('frontdesk.settings.badge') }}" class="rounded-2xl border border-slate-200 bg-white p-5 hover:border-indigo-300">
|
|
<h3 class="font-semibold text-slate-900">Badge template</h3>
|
|
<p class="mt-1 text-sm text-slate-500">Layout, photo, and QR settings</p>
|
|
</a>
|
|
<a href="{{ route('frontdesk.integrations.edit') }}" class="rounded-2xl border border-slate-200 bg-white p-5 hover:border-indigo-300">
|
|
<h3 class="font-semibold text-slate-900">Integrations</h3>
|
|
<p class="mt-1 text-sm text-slate-500">Webhooks and calendar feeds</p>
|
|
</a>
|
|
<a href="{{ route('frontdesk.employees.index') }}" class="rounded-2xl border border-slate-200 bg-white p-5 hover:border-indigo-300">
|
|
<h3 class="font-semibold text-slate-900">Employees</h3>
|
|
<p class="mt-1 text-sm text-slate-500">Staff roster and kiosk PINs</p>
|
|
</a>
|
|
<a href="{{ route('frontdesk.devices.index') }}" class="rounded-2xl border border-slate-200 bg-white p-5 hover:border-indigo-300">
|
|
<h3 class="font-semibold text-slate-900">Devices</h3>
|
|
<p class="mt-1 text-sm text-slate-500">Kiosks, printers, and hardware</p>
|
|
</a>
|
|
@endif
|
|
</div>
|
|
</x-app-layout>
|