
<?php $__env->startSection('title'); ?> পোস্ট <?php $__env->stopSection(); ?>
<?php $__env->startSection('post'); ?> active <?php $__env->stopSection(); ?>
<?php $__env->startSection('post.index'); ?> active <?php $__env->stopSection(); ?>
<?php $__env->startSection('styles'); ?>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('admin_content'); ?>

<!-- BEGIN: Content-->
<div class="app-content content ">
    <div class="card">
        <div class="card-header">
            <div class="head-label">
                <h4>পোস্টের তালিকা</h4>
            </div>
            <div class="dt-action-buttons text-right">
                <div class="dt-buttons d-inline-flex">

                    <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('post-create')): ?>
                    <a href="<?php echo e(route('post.create')); ?>" class="btn btn-primary">নতুন পোস্ট</a>
                    <?php endif; ?>

                </div>
            </div>
        </div>
        <div class="card-body">
            <div class="table-responsive custom-table-modify">
                <table id="myTable" class="table table-bordered">
                    <thead>
                        <tr>
                            <th scope="col">আইডি</th>
                            <th scope="col">ছবি </th>
                            <th scope="col">পোস্ট</th>
                            <th scope="col">একশন</th>
                        </tr>
                    </thead>
                    <tbody>

                        <?php $__currentLoopData = $posts; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $post): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <?php if(isset($post) && $post != null): ?>
                        <?php
                        $postTagData = App\Models\PostTag::getExamListWithPostId($post->id);
                        ?>
                        <tr>
                            <td>
                                <span class=" text-primary" style=" font-weight:600;">C:
                                </span><?php echo e($post->classData->id); ?>,
                                <span class=" text-primary" style=" font-weight:600;">D:
                                </span><?php echo e($post->departmentData->id); ?>,
                                <span class=" text-primary" style=" font-weight:600;">S:
                                </span><?php echo e($post->subjectData->id); ?>,
                                <span class=" text-primary" style=" font-weight:600;">Ch:
                                </span><?php echo e($post->chapterData->id); ?>,
                            </td>
                            <td style="width:25px;">
                                <?php if($post->post_image != null): ?>
                                <img src="<?php echo e(asset('admin/images/posts/thumbnail/'.$post->post_image)); ?>" height="70"
                                    width="70" alt="">
                                <?php else: ?>
                                <img src="<?php echo e(asset('backend/app-assets/images/avatars/12.png')); ?>" height="70" width="70"
                                    alt="">
                                <?php endif; ?>
                            </td>
                            <td class=" text-left">
                                <b class=" d-flex text-primary">শিরোনাম: <span class=" text-dark"
                                        style="font-weight: 100 !important;padding-left: 10px;" class=" pl-1 ml-2"> <?php echo $post->post_title; ?></span></b><br>
                                <b class=" d-flex text-primary">ডেসক্রিপসন: <span class=" text-dark"
                                        style="font-weight: 100 !important;padding-left: 10px;"><?php echo Str::limit($post->post_description, 250); ?></span></b> <br>
                                <b class=" text-primary">রেফারেন্স: </b>
                                <span class=" text-violet" style="font-weight:600;">শ্রেণী:</span>
                                <?php echo e($post->classData->class_name); ?>,
                                <span class=" text-violet" style="font-weight:600;"> বিভাগ: </span>
                                <?php echo e($post->departmentData->department_name); ?>,
                                <span class=" text-violet" style="font-weight:600;">বিষয়: </span>
                                <?php echo e($post->subjectData->subject_name); ?>,
                                <span class=" text-violet" style="font-weight:600;">অধ্যায়: </span>
                                <?php echo e($post->chapterData->chapter_name); ?>

                                <span class=" text-violet" style="font-weight:600;"> ট্যাগের নাম: </span>
                                <?php $__currentLoopData = $postTagData; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $result): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <?php if(isset($result)): ?>
                                <span class=""><?php echo e($result->tagData->tag_name); ?></span>,
                                <?php endif; ?>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                <br>


                            </td>


                            <td>
                                <div class="dropdown">
                                    <button type="button" class="btn btn-sm dropdown-toggle hide-arrow py-0"
                                        data-bs-toggle="dropdown">
                                        <i data-feather="more-vertical"></i>
                                    </button>
                                    <div class="dropdown-menu dropdown-menu-end">

                                        <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('post-edit')): ?>
                                        <a class="dropdown-item" href="<?php echo e(url('/post-edit/'.$post->id)); ?>">
                                            <i data-feather="edit-2" class="me-50"></i>
                                            <span>Edit</span>
                                        </a>
                                        <?php endif; ?>

                                        <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('post-delete')): ?>
                                        <a class="dropdown-item" href="<?php echo e(route('post.delete', $post->id)); ?>">
                                            <i data-feather="trash" class="me-50"></i>
                                            <span>Delete</span>
                                        </a>
                                        <?php endif; ?>

                                    </div>
                                </div>
                            </td>

                        </tr>
                        <?php endif; ?>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

                    </tbody>
                </table>
            </div>

        </div>

        <div class="pagination">
            <?php echo e($posts->links('admin.post.paginate')); ?>

        </div><br>



    </div>

</div>
<!-- END: Content-->

<?php $__env->stopSection(); ?>
<?php echo $__env->make('admin.master', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH E:\Project\Personal-Project\Office-Project\update\testpaper-final\resources\views/admin/post/index.blade.php ENDPATH**/ ?>