
<?php $__env->startSection('content'); ?>
<div class="row match-height">
    <div class="col-md-12 col-12">
        <div class="card">
            <div class="card-header">
                <h4 class="card-title text-primary">Notícias</h4>
                <p class="text-muted">Cadastro de Notícias no Sistema</p>
                <a class="btn btn-outline-primary btn-block d-grid gap-2" type="button" href="<?php echo e(route('noticias.create')); ?>"
                    role="button">Nova notícia</a>
            </div>
            <div class="card">
                <div class="card-body">
                    <div class="table-responsive">
                        <table class="table table-sm table-hover">
                            <thead>
                                <tr>
                                    <th scope="col">Código</th>
                                    <th scope="col">Título</th>
                                    <th scope="col">Data</th>
                                    <th scope="col">Covid</th>
                                    <th scope="col">Concurso</th>
                                    <th scope="col">Secretaria</th>
                                    <th scope="col">Ações</th>
                                </tr>
                            </thead>
                            <tbody>

                                <?php $__currentLoopData = $noticias; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $noticia): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <tr>
                                        <td scope="row"><?php echo e($noticia->id); ?></td>
                                        <td scope="row"><?php echo e($noticia->titulo); ?></td>
                                        <td scope="row"><?php echo e(date('d/m/Y', strtotime($noticia->data))); ?></td>
                                        <td scope="row"><?php echo e($noticia->covid); ?></td>
                                        <td scope="row"><?php echo e($noticia->concurso); ?></td>
                                        <td scope="row"><?php echo e($noticia->secretaria ? $noticia->secretaria->nome : 'Sem Secretaria'); ?></td>
                                        <td>
                                            <a href="<?php echo e(route('noticias.edit', $noticia->id)); ?>"
                                                class="btn btn-sm btn-outline-warning">Editar</a>
                                            <form class="d-inline" method="POST"
                                                action="<?php echo e(route('noticias.destroy', $noticia->id)); ?>"
                                                onSubmit="return confirm('Tem certeza que deseja excluir?')">
                                                <?php echo method_field('DELETE'); ?>
                                                <?php echo csrf_field(); ?>
                                                <button class="btn btn-sm btn-outline-danger">Exluir</button>
                                            </form>
                                        </td>
                                    </tr>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

                            </tbody>
                        </table>
                    </div>
                    <?php echo e($noticias->links('pagination::bootstrap-4')); ?>

                </div>
            </div>
        </div>
    </div>
</div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('admin.layouts.layout', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\laragon\www\portalmunicipal\resources\views/admin/noticias/index.blade.php ENDPATH**/ ?>