Training Part 1.1;

This commit is contained in:
2024-01-27 19:25:20 +01:00
parent 5d05167492
commit 2d6b1bf96a
2 changed files with 47 additions and 20 deletions

View File

@@ -0,0 +1,24 @@
@props(['items' => []])
@props(['fields' => []])
<table class="table table-striped">
<thead>
<tr>
<th>Word</th>
<th>Translation</th>
</tr>
</thead>
<tbody>
@forelse ($items as $item)
<tr>
<td>{{ $item->{$fields[0]} }}</td>
<td>{{ $item->{$fields[1]} }}</td>
</tr>
@empty
<tr>
<td class="text-center" colspan="2">No words</td>
</tr>
@endforelse
</tbody>
</table>

View File

@@ -1,23 +1,26 @@
<x-app-layout>
<table class="table table-striped">
<thead>
<tr>
<th>Word</th>
<th>Translation</th>
</tr>
</thead>
<tbody>
{{-- <table class="table table-striped">--}}
{{-- <thead>--}}
{{-- <tr>--}}
{{-- <th>Word</th>--}}
{{-- <th>Translation</th>--}}
{{-- </tr>--}}
{{-- </thead>--}}
{{-- <tbody>--}}
@forelse ($words as $word)
<tr>
<td>{{$word->name}}</td>
<td>{{$word->translation}}</td>
</tr>
@empty
<tr>
<td class="text-center" colspan="2">No words</td>
</tr>
@endforelse
</tbody>
</table>
{{-- @forelse ($words as $word)--}}
{{-- <tr>--}}
{{-- <td>{{$word->name}}</td>--}}
{{-- <td>{{$word->translation}}</td>--}}
{{-- </tr>--}}
{{-- @empty--}}
{{-- <tr>--}}
{{-- <td class="text-center" colspan="2">No words</td>--}}
{{-- </tr>--}}
{{-- @endforelse--}}
{{-- </tbody>--}}
{{-- </table>--}}
<x-table :items="$words" :fields="array('name','translation')" />
</x-app-layout>