Working interface and parsed symfony cast data to a database.
This commit is contained in:
12
resources/views/components/layout.blade.php
Normal file
12
resources/views/components/layout.blade.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>{{ $title ?? 'Symfonycast.local' }}</title>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet"
|
||||
integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
|
||||
|
||||
</head>
|
||||
<body>
|
||||
{{ $slot }}
|
||||
</body>
|
||||
</html>
|
||||
14
resources/views/course/index.blade.php
Normal file
14
resources/views/course/index.blade.php
Normal file
@@ -0,0 +1,14 @@
|
||||
<x-layout>
|
||||
<h1>
|
||||
{{ $course->name }}
|
||||
</h1>
|
||||
|
||||
<table class="table">
|
||||
@foreach($course->chapters()->get() as $chapter)
|
||||
<tr>
|
||||
<td><a href="{{ route('course.chapter', ['chapter' => $chapter->id]) }}">{{ $chapter->title }}</a></td>
|
||||
<td>{{ $chapter->duration }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</table>
|
||||
</x-layout>
|
||||
24
resources/views/index.blade.php
Normal file
24
resources/views/index.blade.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<x-layout>
|
||||
<table class="table table-sm">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<th></th>
|
||||
<th>Name</th>
|
||||
<th>status</th>
|
||||
<th>Chapters</th>
|
||||
<th>Published at</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@foreach($courses as $course)
|
||||
<tr>
|
||||
<td class="align-middle">{{ $course->id }}</td>
|
||||
<td><img src="{{ $course->thumbnail }}" alt="{{ $course->name }}" class="img-thumbnail" style="width: 70px;"></td>
|
||||
<td class="align-middle"><a href="{{ route('course.index', ['0' => $course->id]) }}"> {{ $course->name }}</a></td>
|
||||
<td class="align-middle">{{ $course->status }}</td>
|
||||
<td class="align-middle">{{ $course->chapters_count }} / {{ $course->numberofchapters }}</td>
|
||||
<td class="align-middle"><abbr title="{{ $course->published_at?->format('Y-m-d') }}">{{ $course->published_at?->diffForHumans() }}</abbr></td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</table>
|
||||
</x-layout>
|
||||
Reference in New Issue
Block a user