Files
ladill-care/resources/views/care/admin/departments/index.blade.php
T
isaaccladandCursor 82a2b1a9a7
Deploy Ladill Care / deploy (push) Successful in 48s
Restrict care unit and department setup to admins.
Nurses keep Nursing Services for clinical work but can no longer browse or create structural units and departments.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-20 11:33:38 +00:00

45 lines
2.4 KiB
PHP

<x-app-layout title="Departments">
<div class="space-y-6">
<x-care.page-hero
badge="Outpatient · Lab · Pharmacy · More"
title="Departments"
description="Define clinical and support departments within each branch to organize care delivery and staffing."
:stats="[
['value' => number_format($heroStats['total']), 'label' => 'Departments'],
['value' => number_format($heroStats['active']), 'label' => 'Active'],
['value' => number_format($heroStats['branches']), 'label' => 'Branches'],
]">
<x-slot name="actions">
<a href="{{ route('care.care-units.index') }}" class="btn-secondary">Care units</a>
@if ($canManage ?? false)
<a href="{{ route('care.departments.create') }}" class="btn-primary">Add department</a>
@endif
</x-slot>
</x-care.page-hero>
<div class="overflow-hidden rounded-2xl border border-slate-200 bg-white">
<table class="min-w-full text-sm">
<thead class="bg-slate-50 text-left text-xs uppercase text-slate-500">
<tr><th class="px-4 py-3">Name</th><th class="px-4 py-3">Type</th><th class="px-4 py-3">Branch</th><th class="px-4 py-3"></th></tr>
</thead>
<tbody class="divide-y divide-slate-50">
@forelse ($departments as $department)
<tr>
<td class="px-4 py-3 font-medium">{{ $department->name }}</td>
<td class="px-4 py-3">{{ $types[$department->type] ?? $department->type }}</td>
<td class="px-4 py-3">{{ $department->branch?->name }}</td>
<td class="px-4 py-3 text-right">
@if ($canManage ?? false)
<a href="{{ route('care.departments.edit', $department) }}" class="text-sky-600">Edit</a>
@endif
</td>
</tr>
@empty
<tr><td colspan="4" class="px-4 py-6 text-center text-slate-500">No departments yet.</td></tr>
@endforelse
</tbody>
</table>
</div>
</div>
</x-app-layout>