@extends('layouts.app') @section('content')
@if(Gate::allows('manage-users') && Gate::allows('manage-items'))
← Back to Dashboard
@elseif(Gate::allows('manage-users'))
← Back to Dashboard
@else
← Back to Dashboard
@endif

Your Class

@if(isset($groups) && $groups->isNotEmpty()) @php $uniqueGroups = $groups->unique('grp_name'); // Remove duplicates based on group name @endphp @foreach($uniqueGroups as $group) @php $count = $studentCounts[$group->grp_name] ?? 0; @endphp
{{ $loop->iteration }}. {{ $group->grp_name }}
Class Date: {{ \Carbon\Carbon::parse($group->date)->format('d M Y') }}
👥 {{ $count }} students
Join Now
@endforeach @else

You are not part of any group.

@endif
@endsection