@extends('layouts.teacher') @php $editing = $homework !== null; $selectedIds = old('student_ids', $homework?->assignees?->pluck('id')->all() ?? []); $audience = old('audience', ($homework && $homework->assignees->isNotEmpty()) ? 'selected' : 'all'); $dueTime = old('due_time', $homework?->due_time ? substr((string) $homework->due_time, 0, 5) : ''); @endphp @section('title', ($editing ? 'Edit homework' : 'Create homework').' ยท '.config('brand.name')) @section('content')
Back @if (session('status'))
{{ session('status') }}
@endif @if ($errors->any())
{{ $errors->first() }}
@endif @if ($lessons->isEmpty())

You are not assigned to a subject yet. Super Admin assigns you to a subject, then you can create homework for enrolled students.

@else
@csrf @if ($editing) @method('PUT') @endif
@if ($editing && $homework->resources->isNotEmpty())
    @foreach ($homework->resources as $resource)
  • {{ $resource->original_filename ?: $resource->title }}
  • @endforeach
@endif

Worksheet, PDF, photo or other file students and parents should download. You can attach more than one.

Assign to

Choosing all enrolled students keeps this homework visible to children who enrol later. Specific students only those you tick now.

No students are enrolled in this subject yet. A parent must enrol the child first.

@endif
@endsection @section('scripts') @endsection