<?php $__env->startSection('content'); ?>
<div class="col-sm-9 col-lg-10">
    <div class="justify-content-center">
        <div class="">
            <div class="card">
                <div class="card-header">
                	<h1><i class="fab fa-product-hunt"></i> communes</h1>
                </div>
				<?php if(session()->has('message')): ?>
				<div class="alert alertToolsBar alert-info alert-dismissible fade show }}"> 
                <?php echo session('message'); ?>

                <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                  </button>
                </div>
				<?php endif; ?>
    					
                <div class="card-body">
					 <table class="table small">
				        <thead>
				            <tr>
				               <th>Code postal</th>
				               <th>nom</th>
				               <th></th>
				            </tr>
				        </thead>
				        <tbody>
				        <?php $__currentLoopData = $communes; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $commune): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
				                <tr>
				                    <td><?php echo e($commune->code_postal); ?></td>
				                    <td><?php echo e($commune->nom); ?></td>
				                    <td><a href="<?php echo e(route('communes.edit',$commune->id)); ?>" class="btn btn-warning btn-block">Modifier</a></td>
				                    <td>
				                        <form action="<?php echo e(route('communes.destroy', $commune->id)); ?>" method ="POST">
				                            <?php echo csrf_field(); ?>
											<?php echo e(method_field('DELETE')); ?>

				                            <button type="button" class="btn btn-danger btn-block" onclick="return confirm('Vraiment supprimer cette commune ?')">Effacer</button>
				                        </form>
				                    </td>
				                </tr>
				            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
				        </tbody>
				    </table>
				    <a href="<?php echo e(route('communes.create')); ?>" class="btn btn-info pull-right">Créer une nouvelle commune</a>
                    <?php echo e($communes->links()); ?>

                
				</div>
				<div class="card-footer">
                	<a href="<?php echo e(route('home')); ?>" class="btn">Retour</a>
                </div>
            </div>
        </div>
    </div>
</div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp\htdocs\leprisme_travaux\resources\views/communes/index.blade.php ENDPATH**/ ?>