This repository has been archived by the owner on Oct 4, 2022. It is now read-only.
/
index.blade.php
executable file
·65 lines (45 loc) · 2.23 KB
/
index.blade.php
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
@extends('admin.admin')
@section('content')
<div class="row">
@include('flash::message')
<div class="row space-bottom">
<div class="desktop-6">
<h1 class="">{!! ucfirst($table) !!}</h1>
</div>
<div class="desktop-6">
<a class="button info" style="margin-top: 10px" href="{!! route('admin.create',[$table,"page=$page"]) !!}">Add New {!! ucfirst( str_singular($table) ) !!}</a>
<a class="button " style="margin-top: 10px" href="{!! route('admin.dashboard') !!}">Back to Dashboard</a>
</div>
</div>
<div class="row space-top">
@if($products->isEmpty())
<div class="well text-center">No Products found.</div>
@else
<table class="table zebra bordered rounded">
<thead>
@foreach($fields as $field)
<th>{!! ucfirst($field) !!}</th>
@endforeach
<th width="50px">Action</th>
</thead>
<tbody>
@foreach($products as $product)
<tr>
@foreach($fields as $field)
<td>{!! $product->$field !!}</td>
@endforeach
<td>
<a href="{!! route('admin.edit', [$table, $product->id, "page=$page"]) !!}"><i class="i-edit"></i></a>
<a href="{!! route('admin.delete', [$table, $product->id]) !!}"
onclick="return confirm('Are you sure wants to delete this Product?')">
<i class="i-close"></i></a>
</td>
</tr>
@endforeach
</tbody>
</table>
{!! $products->render() !!}
@endif
</div>
</div>
@endsection