Files
aroginhealthcare/Modules/Post/resources/views/index.blade.php
2025-08-17 16:23:14 +05:45

112 lines
4.6 KiB
PHP

@extends('admin::layouts.master')
@section('title')
Posts
@endsection
@section('breadcrumb')
@php
$breadcrumbData = [
[
'title' => 'Posts',
'link' => 'null',
],
[
'title' => 'Dashboard',
'link' => route('dashboard'),
],
[
'title' => 'Posts',
'link' => null,
],
];
@endphp
@include('admin::layouts.partials.breadcrumb', $breadcrumbData)
@endsection
@section('content')
<div class="card">
<div class="row">
<div class="col-md-6">
<h4 class="card-header">List of Post</h4>
</div>
<div class="col-md-6">
<div class="flex-column flex-md-row">
<div class="dt-action-buttons text-end pt-3 px-3">
<div class="dt-buttons btn-group flex-wrap">
<a href="{{ route('post.create') }}"
class="btn btn-secondary create-new btn-primary d-none d-sm-inline-block text-white">
<i class="bx bx-plus me-sm-1"></i>
Add New
</a>
</div>
</div>
</div>
</div>
</div>
<div class="card-datatable table-responsive">
<table class="datatables-users table table-hover border-top">
<thead class="table-light">
<tr>
<th>S.N</th>
<th>Title With Image</th>
<th>Page</th>
<th>Actions</th>
</tr>
</thead>
<tbody class="table-border-bottom-0">
@foreach ($posts ?? [] as $post)
<tr>
<td>
#{{ $loop->iteration }}
</td>
<td>
<div class="d-flex align-items-center me-3">
<img src="{{ asset($post->fullImage ?? 'backend/uploads/images/no-Image.jpg') }}" alt="Image" class="rounded me-3" height="40" width="60" style="object-fit: cover">
<div class="card-title mb-0">
<h6 class="mb-0">{{ $post->title }}</h6>
<small class="text-muted">{{ Str::limit($post->short_detail, 80) }}</small>
</div>
</div>
</td>
<td>
{{ optional($post->page)->title }}
</td>
<td>
<div class="dropdown">
<button type="button" class="btn p-0 dropdown-toggle hide-arrow"
data-bs-toggle="dropdown">
<i class="bx bx-dots-vertical-rounded"></i>
</button>
<div class="dropdown-menu">
<a class="dropdown-item"
href="{{ route('post.edit', ['id' => $post->id]) }}"><i
class="bx bx-edit-alt me-1"></i>
Edit</a>
<form method="POST"
action="{{ route('post.delete', ['id' => $post->id]) }}"
id="deleteForm_{{ $post->id }}" class="dropdown-item">
@csrf
@method('DELETE')
<button type="submit" class="border-0 bg-transparent deleteBtn"
style="color:inherit"><i class="bx bx-trash me-1"></i> Delete</button>
</form>
</div>
</div>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
<div class="px-3">
{{ $posts->links('admin::layouts.partials.pagination') }}
</div>
</div>
@endsection