@php $tenant = \App\Support\Facades\Tenancy::get(); $brandStyle = $tenant->brand_primary_color ? ":root { --color-brand-600: {$tenant->brand_primary_color}; } .dark { --color-brand-600: {$tenant->brand_primary_color}; }" : null; $user = auth()->user(); $navGroups = match(true) { (bool) $user->guardian => \App\Support\Navigation\ParentNav::groups('chat', $user->guardian), // Teacher/staff aren't reliably distinguished by the Teacher/Employee // relations (a teacher's Employee row may exist without a linked Teacher // row, or vice versa) — the Spatie role is the authoritative signal, // matching how CourseOfferingController resolves "who can teach". $user->hasRole(['class_teacher', 'subject_teacher']) => \App\Support\Navigation\TeacherNav::groups('chat'), (bool) $user->student => \App\Support\Navigation\StudentNav::groups('chat'), $user->hasRole('staff') => [['label' => 'STAFF PANEL', 'items' => [ ['label' => 'Dashboard', 'icon' => 'home', 'url' => route('tenant.staff.dashboard'), 'active' => false], ['label' => 'Chat', 'icon' => 'phone', 'url' => route('tenant.chat.threads.index'), 'active' => true], ]]], default => \App\Support\Navigation\TenantNav::groups('communication-chat'), }; $brandSubtitle = match(true) { (bool) $user->guardian => 'Parent Panel', $user->hasRole(['class_teacher', 'subject_teacher']) => 'Teacher Panel', (bool) $user->student => 'Student Panel', $user->hasRole('staff') => 'Staff Panel', default => 'Administrator Admin', }; $guardian = $user->guardian; $focusStudent = $guardian ? \App\Support\Navigation\ParentNav::focusStudent($guardian) : null; @endphp @if($guardian) @include('tenant.parent-panel.partials.child-switcher') @endif
@php $isAdmin = ! $user->guardian && ! $user->hasRole(['class_teacher', 'subject_teacher']) && ! $user->student && ! $user->hasRole('staff'); @endphp @if($user->guardian || $user->hasRole(['class_teacher', 'subject_teacher']) || $isAdmin || $user->student) @endif @if($leftThreads->isNotEmpty())

Recently left

@foreach($leftThreads as $thread) @php $leftOthers = $thread->participants->pluck('user')->filter(fn ($p) => $p && $p->id !== $user->id)->values(); $leftLabel = $thread->isGroup() ? $thread->subject : ($leftOthers->pluck('name')->implode(', ') ?: ($thread->subject ?? 'Conversation')); @endphp

{{ $leftLabel }}

You left this conversation

@csrf
@endforeach
@endif @if($user->guardian)
@csrf
@elseif($user->hasRole(['class_teacher', 'subject_teacher']))
@csrf

Only teachers who share a class with you are listed.

@csrf

Only students enrolled in your classes are listed.

@elseif($user->student)
@csrf
@csrf

Only students in your own section are listed.

@elseif($isAdmin)
@csrf
@csrf
@csrf

Creates one shared group conversation everyone in this audience can see and reply to.

@endif