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
@extends('master')
@section('content')
<div class="row">
<div class="col-md-12">
<h1>Simple Ajax CRUD</h1>
</div>
</div>
<div class="row">
<table class="table table-striped">
<tr>
<th>No.</th>
<th>Title</th>
<th>Description</th>
<th>Images</th>
<th>Actions</th>
</tr>
<a href="{{route('blog.create')}}" class="btn btn-info pull-right">Create New Data</a><br><br>
<?php $no=1; ?>
@foreach($blogs as $blog)
<tr>
<td>{{$no++}}</td>
<td>{{$blog->title}}</td>
<td>{{$blog->description}}</td>
<td><img src="<?php echo asset("image/$blog->images")?>" style="max-height:40px; max-width: 40px; margin-top:10px; /> </img></td>
<td>
<form class="" action="{{route('blog.destroy',$blog->id)}}" method="post">
<input type="hidden" name="_method" value="delete">
<input type="hidden" name="_token" value="{{ csrf_token() }}">
<a href="{{route('blog.edit',$blog->id)}}" class="btn btn-primary">Edit</a>
<input type="submit" class="btn btn-danger" onclick="return confirm('Are you sure to delete this data');" name="name" value="delete">
</form>
</td>
</tr>
@endforeach
</table>
</div>
@stop