191 lines
9.4 KiB
PHP
191 lines
9.4 KiB
PHP
<x-filament-panels::page>
|
|
@php
|
|
$user = auth()->user();
|
|
|
|
$groups = [
|
|
[
|
|
'label' => __('navigation.groups.patients'),
|
|
'color' => 'blue',
|
|
'cards' => [
|
|
[
|
|
'title' => __('navigation.patients.title'),
|
|
'description' => __('navigation.patients.description'),
|
|
'icon' => 'heroicon-o-user-group',
|
|
'url' => \App\Filament\Resources\PatientResource::getUrl('index'),
|
|
'permission' => 'ViewAny:Patient',
|
|
],
|
|
[
|
|
'title' => __('navigation.visits.title'),
|
|
'description' => __('navigation.visits.description'),
|
|
'icon' => 'heroicon-o-calendar',
|
|
'url' => \App\Filament\Resources\VisitResource::getUrl('index'),
|
|
'permission' => 'ViewAny:Visit',
|
|
],
|
|
[
|
|
'title' => __('navigation.prescriptions.title'),
|
|
'description' => __('navigation.prescriptions.description'),
|
|
'icon' => 'heroicon-o-document-text',
|
|
'url' => \App\Filament\Resources\PrescriptionResource::getUrl('index'),
|
|
'permission' => 'ViewAny:Prescription',
|
|
],
|
|
[
|
|
'title' => __('navigation.surgery_appointments.title'),
|
|
'description' => __('navigation.surgery_appointments.description'),
|
|
'icon' => 'heroicon-o-calendar-days',
|
|
'url' => \App\Filament\Resources\SurgeryAppointmentResource::getUrl('index'),
|
|
'permission' => 'ViewAny:SurgeryAppointment',
|
|
],
|
|
],
|
|
],
|
|
[
|
|
'label' => __('navigation.groups.diseases'),
|
|
'color' => 'orange',
|
|
'cards' => [
|
|
[
|
|
'title' => __('navigation.patient_illness.title'),
|
|
'description' => __('navigation.patient_illness.description'),
|
|
'icon' => 'heroicon-o-heart',
|
|
'url' => \App\Filament\Resources\PatientIllnessResource::getUrl('index'),
|
|
'permission' => 'ViewAny:PatientIllness',
|
|
],
|
|
[
|
|
'title' => __('navigation.treatments.title'),
|
|
'description' => __('navigation.treatments.description'),
|
|
'icon' => 'heroicon-o-clipboard-document-list',
|
|
'url' => \App\Filament\Resources\TreatmentResource::getUrl('index'),
|
|
'permission' => 'ViewAny:Treatment',
|
|
],
|
|
[
|
|
'title' => __('navigation.medications.title'),
|
|
'description' => __('navigation.medications.description'),
|
|
'icon' => 'heroicon-o-beaker',
|
|
'url' => \App\Filament\Resources\MedicationResource::getUrl('index'),
|
|
'permission' => 'ViewAny:Medication',
|
|
],
|
|
],
|
|
],
|
|
[
|
|
'label' => __('navigation.groups.clinic'),
|
|
'color' => 'teal',
|
|
'cards' => [
|
|
[
|
|
'title' => __('navigation.doctors.title'),
|
|
'description' => __('navigation.doctors.description'),
|
|
'icon' => 'heroicon-o-user-circle',
|
|
'url' => \App\Filament\Resources\DoctorResource::getUrl('index'),
|
|
'permission' => 'ViewAny:Doctor',
|
|
],
|
|
[
|
|
'title' => __('navigation.payment_types.title'),
|
|
'description' => __('navigation.payment_types.description'),
|
|
'icon' => 'heroicon-o-credit-card',
|
|
'url' => \App\Filament\Resources\PaymentTypeResource::getUrl('index'),
|
|
'permission' => 'ViewAny:PaymentType',
|
|
],
|
|
[
|
|
'title' => __('navigation.surgery_centers.title'),
|
|
'description' => __('navigation.surgery_centers.description'),
|
|
'icon' => 'heroicon-o-building-office-2',
|
|
'url' => \App\Filament\Resources\SurgeryCenterResource::getUrl('index'),
|
|
'permission' => 'ViewAny:SurgeryCenter',
|
|
],
|
|
[
|
|
'title' => __('navigation.users.title'),
|
|
'description' => __('navigation.users.description'),
|
|
'icon' => 'heroicon-o-users',
|
|
'url' => \App\Filament\Resources\UserResource::getUrl('index'),
|
|
'permission' => 'ViewAny:User',
|
|
],
|
|
],
|
|
],
|
|
[
|
|
'label' => __('navigation.groups.settings'),
|
|
'color' => 'slate',
|
|
'cards' => [
|
|
[
|
|
'title' => __('navigation.osurg_audit.title'),
|
|
'description' => __('navigation.osurg_audit.description'),
|
|
'icon' => 'heroicon-o-clipboard-document-list',
|
|
'url' => \App\Filament\Resources\OsurgAuditResource::getUrl('index'),
|
|
'permission' => 'ViewAny:SyncLog',
|
|
],
|
|
[
|
|
'title' => __('navigation.osurg_initials.title'),
|
|
'description' => __('navigation.osurg_initials.description'),
|
|
'icon' => 'heroicon-o-adjustments-horizontal',
|
|
'url' => \App\Filament\Resources\OsurgInitialResource::getUrl('index'),
|
|
'permission' => 'ViewAny:OsurgInitial',
|
|
],
|
|
[
|
|
'title' => __('navigation.sms_logs.title'),
|
|
'description' => __('navigation.sms_logs.description'),
|
|
'icon' => 'heroicon-o-chat-bubble-left-ellipsis',
|
|
'url' => \App\Filament\Pages\SmsLogsPage::getUrl(),
|
|
'permission' => 'View:SmsLogsPage',
|
|
],
|
|
[
|
|
'title' => __('navigation.roles.title'),
|
|
'description' => __('navigation.roles.description'),
|
|
'icon' => 'heroicon-o-shield-check',
|
|
'url' => \App\Filament\Resources\RoleResource::getUrl('index'),
|
|
'permission' => 'ViewAny:Role',
|
|
],
|
|
],
|
|
],
|
|
];
|
|
|
|
$groups = array_filter(array_map(function ($group) use ($user) {
|
|
$group['cards'] = array_filter($group['cards'], fn ($card) =>
|
|
!isset($card['permission']) || $user->can($card['permission'])
|
|
);
|
|
return $group;
|
|
}, $groups), fn ($group) => !empty($group['cards']));
|
|
@endphp
|
|
|
|
<div class="space-y-8">
|
|
|
|
<div class="grid grid-cols-1 gap-6 lg:grid-cols-2">
|
|
@foreach (array_slice($groups, 0, 2) as $group)
|
|
<div>
|
|
<h2 class="mb-4 text-sm font-semibold uppercase tracking-widest text-gray-400 dark:text-gray-500">
|
|
{{ $group['label'] }}
|
|
</h2>
|
|
<div class="grid grid-cols-1 gap-3 sm:grid-cols-2">
|
|
@foreach ($group['cards'] as $card)
|
|
<x-navigation-card
|
|
:title="$card['title']"
|
|
:description="$card['description']"
|
|
:icon="$card['icon']"
|
|
:url="$card['url']"
|
|
:color="$group['color']"
|
|
/>
|
|
@endforeach
|
|
</div>
|
|
</div>
|
|
@endforeach
|
|
</div>
|
|
|
|
<div class="grid grid-cols-1 gap-6 lg:grid-cols-2">
|
|
@foreach (array_slice($groups, 2) as $group)
|
|
<div>
|
|
<h2 class="mb-4 text-sm font-semibold uppercase tracking-widest text-gray-400 dark:text-gray-500">
|
|
{{ $group['label'] }}
|
|
</h2>
|
|
<div class="grid grid-cols-1 gap-3 sm:grid-cols-2">
|
|
@foreach ($group['cards'] as $card)
|
|
<x-navigation-card
|
|
:title="$card['title']"
|
|
:description="$card['description']"
|
|
:icon="$card['icon']"
|
|
:url="$card['url']"
|
|
:color="$group['color']"
|
|
/>
|
|
@endforeach
|
|
</div>
|
|
</div>
|
|
@endforeach
|
|
</div>
|
|
|
|
</div>
|
|
</x-filament-panels::page>
|