135 lines
5.5 KiB
PHP
135 lines
5.5 KiB
PHP
@extends('admin::layouts.master')
|
|
|
|
@section('title')
|
|
FAQ
|
|
@endsection
|
|
|
|
@section('breadcrumb')
|
|
@php
|
|
$breadcrumbData = [
|
|
[
|
|
'title' => 'FAQ',
|
|
'link' => 'null',
|
|
],
|
|
[
|
|
'title' => 'Dashboard',
|
|
'link' => route('dashboard'),
|
|
],
|
|
[
|
|
'title' => 'FAQs',
|
|
'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 FAQ</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('cms.faqs.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 border-top">
|
|
<thead class="table-light">
|
|
<tr>
|
|
<th>S.N</th>
|
|
<th>Question</th>
|
|
<th>Answer</th>
|
|
<th>Ordering</th>
|
|
<th>Status</th>
|
|
<th>Actions</th>
|
|
</tr>
|
|
</thead>
|
|
|
|
<tbody class="table-border-bottom-0">
|
|
@if(count($faqs) > 0)
|
|
@foreach ($faqs ?? [] as $faq)
|
|
<tr>
|
|
<td>
|
|
#{{ $loop->iteration }}
|
|
</td>
|
|
<td>
|
|
{{ Str::words($faq->question, 4, '...') }}
|
|
</td>
|
|
<td>
|
|
{{ Str::words($faq->answer, 7, '...') }}
|
|
</td>
|
|
<td>
|
|
{{ $faq->ordering }}
|
|
</td>
|
|
<td>
|
|
<span
|
|
class="badge bg-label-{{ $faq->status == 'active' ? 'success' : 'danger' }}">
|
|
{{ $faq->status }}</span>
|
|
</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('cms.faqs.edit', ['uuid' => $faq->uuid]) }}"><i
|
|
class="bx bx-edit-alt me-1"></i>
|
|
Edit</a>
|
|
|
|
{{-- <div class="dropdown-item btn-delete" data-name="[ {{ $faq->question }} ]"
|
|
data-action="{{ route('cms.faqs.delete', ['uuid' => $faq->uuid]) }}"
|
|
>
|
|
<i class="bx bx-trash me-1"></i> Delete
|
|
</div> --}}
|
|
<form method="POST" action="{{ route('cms.faqs.delete', ['uuid' => $faq->uuid]) }}"
|
|
id="deleteForm_{{ $faq->uuid }}" 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
|
|
@else
|
|
<tr>
|
|
<td colspan="6">No record found.</td>
|
|
</tr>
|
|
@endif
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div class="px-3">
|
|
{{ $faqs->links('admin::layouts.partials.pagination') }}
|
|
</div>
|
|
</div>
|
|
@endsection
|
|
|
|
{{-- style --}}
|
|
@push('required-styles')
|
|
@include('admin::vendor.dataTables.style')
|
|
@endpush
|
|
|
|
{{-- script --}}
|
|
@push('required-scripts')
|
|
@include('admin::vendor.dataTables.script')
|
|
@endpush
|