add table viewing page
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@php
|
||||
/** @var \App\Models\Table $table */
|
||||
@endphp
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<h2>{{ $table->title }}</h2>
|
||||
</div>
|
||||
<div class="row justify-content-center">
|
||||
|
||||
<div class="col-md-8">
|
||||
<table class="table table-hover table-sm">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
@foreach($columns as $col)
|
||||
<th>{{ $col->title }}</th>
|
||||
@endforeach
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($rows as $row)
|
||||
<tr>
|
||||
<td>#{{ $row->id }}</td>
|
||||
@php($rdata = json_decode($row['data'], true))
|
||||
@foreach($columns as $col)
|
||||
<td data-id="{{ $row->id }}">{{ $rdata[$col->name] }}</td>
|
||||
@endforeach
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
Reference in New Issue
Block a user