| Path : /var/www/html/phkaynews-v2/resources/views/admin/post/ |
|
B-Con CMD Config cPanel C-Rdp D-Log Info Jump Mass Ransom Symlink vHost Zone-H |
| Current File : /var/www/html/phkaynews-v2/resources/views/admin/post/postList.blade.php |
@extends('layouts.admin')
@section('title','Admin Posts Management')
@section('content')
<div class="row">
<x-content-header title="Post" />
<div class="col-12">
<x-card>
<div class="row mb-2">
<div class="col-sm-4">
<div class="search-box mr-2 mb-2">
<form action="{{route('admin.posts.search')}}" method="get" class="d-flex">
<div class="position-relative">
<input type="text" name="q" @isset($q) value="{{ $q }}" @endisset class="form-control" placeholder="Search...">
<i class="bx bx-search-alt search-icon"></i>
</div>
<button type="submit" class="btn btn-primary rounded-pill waves-effect waves-light d-flex">
<i class="bx bx-search font-size-16 align-middle mr-2"></i> search
</button>
</form>
</div>
</div>
<div class="col-sm-8">
<div class="text-sm-right">
<a href="{{ route('admin.posts.create') }}" wire:click="formOpen"
class="btn btn-success btn-rounded waves-effect waves-light mb-2 mr-2">
<i class="mdi mdi-plus mr-1"></i> Add New
</a>
</div>
</div>
</div>
<x-table>
<thead class="thead-light">
<tr>
<th>Thumbnail</th>
<th>Title</th>
<th>Post By</th>
<th>Views</th>
<th>Public</th>
<th>Created At</th>
<th>Action</th>
</tr>
</thead>
<tbody>
@forelse ($posts as $key => $post)
<tr>
<td class="td-pointer"
x-data
@click="
window.location.href ='{{ route("admin.posts.edit",$post->id) }}'
"
>
<img src="{{ !empty($post->feature_image) ? asset($post->feature_image) : asset('admin/images/no-image.jpg') }}" alt="thumbnail" class="rounded avatar-sm my-object-fit">
</td>
<td class="text-left td-pointer"
x-data
@click="
window.location.href ='{{ route("admin.posts.edit",$post->id) }}'
"
>
{{ Str::limit($post->title, 50, '...') }}
</td>
<td class="text-center td-pointer"
x-data
@click="
window.location.href ='{{ route("admin.posts.edit",$post->id) }}'
"
>
{{ $post->user->name }}
</td>
<td class="text-center td-pointer"
x-data
@click="
window.location.href ='{{ route("admin.posts.edit",$post->id) }}'
"
>
<span class="badge badge-pill badge-soft-info font-size-12">{{ $post->view }}</span>
</td>
<td class="text-center td-pointer"
x-data
@click="
window.location.href ='{{ route("admin.posts.edit",$post->id) }}'
"
>
@if ($post->public)
<span class="badge badge-pill badge-soft-success font-size-12">Publiced</span>
@else
<span class="badge badge-pill badge-soft-danger font-size-12">Private</span>
@endif
</td>
<td class="td-pointer"
x-data
@click="
window.location.href ='{{ route("admin.posts.edit",$post->id) }}'
"
>
{{ $post->created_at ? date_format($post->created_at, 'd-M-Y H:i a') : 'Null' }}
</td>
<td>
<a href="{{ route('admin.posts.edit',$post->id) }}" class="mr-3 text-primary" data-toggle="tooltip" data-placement="top" title="" data-original-title="Edit">
<i class="mdi mdi-pencil font-size-18"></i>
</a>
<a href="#" class="text-danger"
x-data
@click="
Swal.fire({
title: 'Are you sure?',
text: 'You won\'t be able to revert this!',
icon: 'warning',
confirmButtonText: 'Yes, delete it!',
showCancelButton: !0,
cancelButtonText: 'No, cancel!',
confirmButtonClass: 'btn btn-success mt-2',
cancelButtonClass: 'btn btn-danger ml-2 mt-2',
buttonsStyling: !1,
}).then((result) => {
if (result.value) {
document.getElementById('frmDelete-{{ $post->id }}').submit();
}
})
"
data-toggle="tooltip"
data-placement="top"
title="" data-original-title="Delete"
>
<i class="mdi mdi-close font-size-18"></i>
</a>
<form id="frmDelete-{{ $post->id }}" action="{{ route('admin.posts.destroy',$post->id) }}" method="POST" class="d-none">
@csrf
@method('DELETE')
</form>
</td>
</tr>
@empty
<tr>
<td colspan="15" class="py-2 text-center">
<span class="badge badge-pill badge-soft-danger font-size-12">មិនមានទិន្នន័យ</span>
</td>
</tr>
@endforelse
</tbody>
</x-table>
{{ $posts->links() }}
</x-card>
</div>
</div>
@endsection