40 lines
1.9 KiB
PHP
40 lines
1.9 KiB
PHP
<x-layout.app>
|
|
<x-card.card class="mx-auto max-w-xl">
|
|
<x-card.heading>
|
|
Edit Student
|
|
@if($student->entries_count === 0)
|
|
<x-slot:right_side>
|
|
<x-delete-resource-modal title="Delete Student {{ $student->full_name() }} from {{ $student->school->name }}" :action="route('admin.students.destroy',$student)">
|
|
Please confirm you'd like to delete this student. This action cannot be undone.
|
|
</x-delete-resource-modal>
|
|
</x-slot:right_side>
|
|
@endif
|
|
</x-card.heading>
|
|
<x-form.form method="PATCH" action="{{ route('admin.students.update',$student) }}">
|
|
<x-form.body-grid columns="8">
|
|
<x-form.field name="first_name" label_text="First Name" colspan="3" value="{{ $student->first_name }}" />
|
|
<x-form.field name="last_name" label_text="Last Name" colspan="3" value="{{ $student->last_name }}" />
|
|
<x-form.select name="grade" colspan="2">
|
|
<x-slot:label>Grade</x-slot:label>
|
|
@php($n = $minGrade)
|
|
@while($n <= $maxGrade)
|
|
<option value="{{ $n }}" {{ ($n == $student->grade ? 'selected':'') }}>{{ $n }}</option>
|
|
@php($n++);
|
|
@endwhile
|
|
</x-form.select>
|
|
<x-form.select name="school_id" colspan="8">
|
|
<x-slot:label>School</x-slot:label>
|
|
@foreach ($schools as $school)
|
|
|
|
<option value="{{ $school->id }}" {{ ($school->id == $student->school_id ? 'selected':'') }}> {{ $school->name }}</option>
|
|
@endforeach
|
|
|
|
</x-form.select>
|
|
</x-form.body-grid>
|
|
<x-form.footer class="mb-4">
|
|
<x-form.button>Edit Student</x-form.button>
|
|
</x-form.footer>
|
|
</x-form.form>
|
|
</x-card.card>
|
|
</x-layout.app>
|