aboutsummaryrefslogtreecommitdiffstats
path: root/resources/views/groups/edit.blade.php
blob: b2783c37ac123ac5dbe9f1d08bd09e3ebc19f17d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
@extends('layouts.app')

@section('title', 'Edit Group - Teacher Journal')

@push('styles')
<link rel="stylesheet" href="{{ asset('css/groups.css') }}">
@endpush

@section('content')
<a href="{{ route('groups.index') }}">Back to Groups</a>

<h5>Edit Group</h5>

<form action="{{ route('groups.update', $group) }}" method="POST">
    @csrf
    @method('PUT')

    <label for="name">Group Name</label>
    <input type="text" name="name" id="name" required value="{{ $group->name }}">

    <label for="teacher_id">Teacher</label>
    <select name="teacher_id" id="teacher_id" required>
        <option value="">Select a teacher</option>
        @foreach($teachers as $id => $name)
            <option value="{{ $id }}" @selected($group->teacher_id == $id)>{{ $name }}</option>
        @endforeach
    </select>

    <button type="submit">Update Group</button>
    <a href="{{ route('groups.index') }}">Cancel</a>
</form>
@endsection