@extends('layouts.app') @section('title', 'Homework') @push('styles') @endpush @section('content') @php $hwJson = $homework->map(function ($h) { return ['id' => $h->id, 'subject' => $h->subject, 'description' => $h->description, 'due_date' => $h->due_date ? \Carbon\Carbon::parse($h->due_date)->format('Y-m-d') : '', 'status' => $h->status]; }); @endphp

Homework tracker

@if(request('batch') !== 'all' && request('batch')) Clear @endif
@forelse ($homework as $hw)
{{ $hw->subject }}
{{ $hw->batch->name ?? '' }}

{{ $hw->description }}

Assigned: {{ $hw->assigned_date ? \Carbon\Carbon::parse($hw->assigned_date)->format('d M Y') : '—' }} Due: {{ $hw->due_date ? \Carbon\Carbon::parse($hw->due_date)->format('d M Y') : '—' }}
{{ $hw->status }}
@empty
No homework assigned yet.
@endforelse
@if(method_exists($homework, 'links'))
{{ $homework->appends(request()->query())->links() }}
@endif

Confirm Delete

Are you sure? This cannot be undone.

@csrf @method('DELETE')
@endsection