@extends('dashboard.admin.layouts.app')
@section('content')
<div class="row justify-content-center">
<div class="col-12">
<h2 class="mb-2 page-title">FAQs</h2>
<p class="card-text">FAQs table.</p>
<div class="row my-4">
<!-- data table -->
<div class="col-md-12">
<a href="{{ route('faqs.create') }}" class="btn btn-primary mb-2">Add New FAQ</a>
<div class="card shadow">
<div class="card-body">
<!-- table -->
<table class="table datatables" id="dataTable-1">
<thead>
<tr>
<th></th>
<th>Sr#</th>
{{-- <th>Model</th> --}}
<th>EventsCountryTab</th>
<th>Question</th>
<th>Answer</th>
<th>Status</th>
<th>Date</th>
<th>Action</th>
</tr>
</thead>
<tbody>
@php $counter = 1 @endphp
@foreach ($faqs as $faq)
<tr>
<td>
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input">
<label class="custom-control-label"></label>
</div>
</td>
<td>{{ $counter++ }}</td>
{{-- <td>{{ $faq->modelable_type }}</td> --}}
<td>{{ $faq->eventsCountryTab->tab }}</td>
<td>{{ $faq->question }}</td>
<td>{{ Str::limit($faq->answer, 50) }}</td>
<td>
@if($faq->status == 1)
Active
@else
Inactive
@endif
</td>
<td>{{ $faq->created_at->format('Y-m-d') }}</td>
<td>
<button class="btn btn-sm rounded dropdown-toggle more-horizontal text-muted"
type="button" data-toggle="dropdown" aria-haspopup="true"
aria-expanded="false">
<span class="text-muted sr-only">Action</span>
</button>
<div class="dropdown-menu dropdown-menu-right shadow">
<a class="dropdown-item" href="{{ route('faqs.edit', $faq->id) }}"><i
class="fe fe-edit-2 fe-12 mr-3 text-muted"></i>Edit</a>
<form action="{{ route('faqs.destroy', $faq->id) }}" method="POST">
@csrf
@method('DELETE')
<button type="submit" class="dropdown-item"><i
class="fe fe-trash fe-12 mr-3 text-muted"></i>Remove</button>
</form>
</div>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div> <!-- data table -->
</div> <!-- end section -->
</div> <!-- .col-12 -->
</div>
@endsection