auditionadmin/resources/views/admin/students/edit.blade.php

31 lines
1.4 KiB
PHP

<x-layout.app>
<x-card.card class="mx-auto max-w-xl">
<x-card.heading>Edit Student</x-card.heading>
<x-form.form method="PATCH" action="/admin/students/{{ $student->id }}">
<x-form.body-grid columns="12">
<x-form.field name="first_name" label_text="First Name" colspan="5" value="{{ $student->first_name }}" />
<x-form.field name="last_name" label_text="Last Name" colspan="5" 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="12">
<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>
<x-form.button>Ecit Student</x-form.button>
</x-form.footer>
</x-form.form>
</x-card.card>
</x-layout.app>