Sindbad~EG File Manager
<?php $__env->startSection('title','List Categories'); ?>
<?php $__env->startSection('breadcrumbs', 'Overview Categories'); ?>
<?php $__env->startSection('content'); ?>
<!-- Widgets -->
<div class="row">
<div class="col-md-12">
<div class="card">
<div class="card-body">
<div class="my-3 text-right">
<a href="<?php echo e(route('categories.create')); ?>" class="btn btn-sm btn-success"> <i class="fa fa-plus"></i> Create</a>
</div>
<?php if(session('success')): ?>
<div class="alert alert-success alert-dismissible fade show" role="alert">
<?php echo e(session('success')); ?>
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<?php endif; ?>
<table class="table table-striped table-bordered" >
<thead class="text-light" style="background-color:#33b751 !important">
<tr class="text-center">
<th style="width:10px">No</th>
<th>Category</th>
<th>Slug</th>
<th>Image</th>
<th style="width:165px">Action</th>
</tr>
</thead>
<tbody>
<?php $__currentLoopData = $categories; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $index => $category): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<tr>
<td><?php echo e($index+1); ?></td>
<td><?php echo e($category->name); ?></td>
<td><?php echo e($category->slug); ?></td>
<td align="center">
<?php if($category->image): ?>
<img src="<?php echo e(asset('category_image/'.$category->image)); ?>" alt="" width="100px">
<?php endif; ?>
</td>
<td>
<a href="<?php echo e(route('categories.edit', [$category->id])); ?>" class="btn btn-sm btn-warning text-light"><i class="fa fa-pencil"></i> Edit</a>
<button class="btn btn-sm btn-danger" onclick="deleteConfirm('<?php echo e($category->id); ?>', '<?php echo e($category->name); ?>')" data-target="#modalDelete" data-toggle="modal"><i class="fa fa-trash"></i> Delete</button>
</td>
</tr>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
<!-- /Widgets -->
<!-- Modal Delete -->
<div class="modal fade" id="modalDelete" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title d-inline">Delete Category</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body" id="message">
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
<form action="" id="url" method="POST" class="d-inline">
<?php echo csrf_field(); ?>
<?php echo method_field('DELETE'); ?>
<button type="submit" class="btn btn-danger">Delete</button>
</form>
</div>
</div>
</div>
</div>
<!-- End Modal Delete -->
<?php $__env->stopSection(); ?>
<?php $__env->startSection('script'); ?>
<script>
function deleteConfirm(id, name){
var url = '<?php echo e(route("categories.destroy", ":id")); ?>';
url = url.replace(':id', id);
document.getElementById("url").setAttribute("action", url);
document.getElementById('message').innerHTML ="Are you sure want to delete category "+name+" ?"
$('#modalDelete').modal();
}
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.admin', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp\htdocs\Company-Profile-Laravel\resources\views/categories/index.blade.php ENDPATH**/ ?>
Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists