atcheck/resources/views/admin/admin_subjects.blade.php

41 lines
1.6 KiB
PHP

@extends('layouts.adminpanel')
@section('title') Admin Panel - Subjects @endsection
@section('admin_content')
<div class="container">
<div class="row justify-content-center">
<div class="col-md-8">
@if ($subjects->count() > 0)
<h5> All subjects: ({{ $subjects->count() }}) </h5>
<table>
<tr>
<th>ID</th>
<th> Name </th>
<th> Type </th>
<th> User id </th>
<th> Room id </th>
<th> Creation date </th>
</tr>
@foreach ($subjects as $subject)
<tr>
<td> {{ $subject->id }}</td>
<td> {{ $subject->name }} </td>
<td> {{ $subject->type }} </td>
<td> {{ $subject->user_id}}</td>
<td> {{ $subject->room_id}}</td>
<td> {{ $subject->created_at }} </td>
<td>
<a href="{{ route('admin_delete_subject', ['subject_id' => $subject->id]) }}" name="delete-subject-btn"> Delete </a>
</td>
</tr>
@endforeach
</table>
@else
<p> No subjects yet. </p>
@endif
</div>
</div>
</div>
@endsection