{{-- Today's Homework Widget --}} {{-- Usage: @include('components.homework-widget', ['homework' => $collection, 'compact' => false]) --}} @php $hwItems = $homework ?? collect(); @endphp @if($hwItems->isNotEmpty())

Today's Homework

{{ $hwItems->count() }} {{ Str::plural('item', $hwItems->count()) }} assigned

View All
@foreach($hwItems->take(isset($compact) && $compact ? 3 : 5) as $hw) @php $colors = ['bg-amber-500','bg-blue-500','bg-emerald-500','bg-purple-500','bg-rose-500','bg-cyan-500']; $dotColor = $colors[$hw->subject_id % count($colors)]; @endphp
{{ $hw->subject->name ?? '—' }} {{ $hw->teacher->name ?? '' }}

{{ Str::limit($hw->title, 70) }}

@if($hw->attachment) @endif
@endforeach
@if($hwItems->count() > (isset($compact) && $compact ? 3 : 5))
+{{ $hwItems->count() - (isset($compact) && $compact ? 3 : 5) }} more
@endif
@endif