You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

55 lines
1.8 KiB

@extends('layouts.app')
@section('title', 'Posts')
@section('content')
<div class="row">
<div class="col-md-5">
<h3 class="modal-title">{{ $result->total() }} {{ str_plural('Post', $result->count()) }} </h3>
</div>
<div class="col-md-7 page-action text-right">
@can('add_posts')
<a href="{{ route('posts.create') }}" class="btn btn-primary btn-sm"> <i class="glyphicon glyphicon-plus-sign"></i> Create</a>
@endcan
</div>
</div>
<div class="result-set">
<table class="table table-bordered table-striped table-hover" id="data-table">
<thead>
<tr>
<th>Id</th>
<th>Title</th>
<th>Author</th>
<th>Created At</th>
@can('edit_posts', 'delete_posts')
<th class="text-center">Actions</th>
@endcan
</tr>
</thead>
<tbody>
@foreach($result as $item)
<tr>
<td>{{ $item->id }}</td>
<td>{{ $item->title }}</td>
<td>{{ $item->user['name'] }}</td>
<td>{{ $item->created_at->toFormattedDateString() }}</td>
@can('edit_posts', 'delete_posts')
<td class="text-center">
@include('shared._actions', [
'entity' => 'posts',
'id' => $item->id
])
</td>
@endcan
</tr>
@endforeach
</tbody>
</table>
<div class="text-center">
{{ $result->links() }}
</div>
</div>
@endsection