<?php $__env->startSection('panel'); ?>
    <div class="row">
        <div class="col-lg-12">
            <div class="card b-radius--10">
                <div class="card-body p-0">
                    <div class="table-responsive--md">
                        <table class="table--light style--two table">
                            <thead>
                                <tr>
                                    <th><?php echo app('translator')->get('Logo'); ?></th>
                                    <th><?php echo app('translator')->get('Name'); ?></th>
                                    <th><?php echo app('translator')->get('Products'); ?></th>
                                    <th><?php echo app('translator')->get('Is Featured'); ?></th>
                                    <th><?php echo app('translator')->get('Action'); ?></th>
                                </tr>
                            </thead>

                            <tbody class="list">
                                <?php $__empty_1 = true; $__currentLoopData = $brands; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $brand): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                                    <tr>
                                        <td>

                                            <div class="table-thumb">
                                                <a href="<?php echo e($brand->logo()); ?>" class="image-popup">
                                                    <img src="<?php echo e($brand->logo()); ?>" alt="<?php echo app('translator')->get('image'); ?>">
                                                </a>
                                            </div>

                                        </td>
                                        <td><?php echo e(__($brand->name)); ?></td>

                                        <td>
                                            <a href="<?php echo e(route('admin.products.all')); ?>?brand_id=<?php echo e($brand->id); ?>"><?php echo e($brand->products_count); ?></a>
                                        </td>

                                        <td>
                                            <?php if (isset($component)) { $__componentOriginal319c173192d983146c5bd67854bb9452 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal319c173192d983146c5bd67854bb9452 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.toggle-switch','data' => ['class' => 'change_status','checked' => $brand->is_featured,'dataId' => ''.e($brand->id).'']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('toggle-switch'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['class' => 'change_status','checked' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($brand->is_featured),'data-id' => ''.e($brand->id).'']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal319c173192d983146c5bd67854bb9452)): ?>
<?php $attributes = $__attributesOriginal319c173192d983146c5bd67854bb9452; ?>
<?php unset($__attributesOriginal319c173192d983146c5bd67854bb9452); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal319c173192d983146c5bd67854bb9452)): ?>
<?php $component = $__componentOriginal319c173192d983146c5bd67854bb9452; ?>
<?php unset($__componentOriginal319c173192d983146c5bd67854bb9452); ?>
<?php endif; ?>
                                        </td>

                                        <td>
                                            <div class="button--group">
                                                <?php
                                                    $brand->image_with_path = $brand->logo();
                                                ?>

                                                <?php if(!Route::is('admin.brand.trashed')): ?>
                                                    <button type="button" class="btn btn-sm btn-outline--primary cuModalBtn editBtn"data-resource="<?php echo e($brand); ?>" data-modal_title="<?php echo app('translator')->get('Edit Brand'); ?>" data-has_status="1">
                                                        <i class="la la-pencil"></i><?php echo app('translator')->get('Edit'); ?>
                                                    </button>
                                                <?php endif; ?>

                                                <?php if(!$trashed): ?>
                                                    <button type="button" class="btn btn-sm btn-outline--danger confirmationBtn" data-action="<?php echo e(route('admin.brand.delete', $brand->id)); ?>" data-question="<?php echo app('translator')->get('Are you sure to delete this brand?'); ?>"><i class="las la-trash-alt"></i><?php echo app('translator')->get('Delete'); ?>
                                                    </button>
                                                <?php else: ?>
                                                    <button type="button" class="btn btn-sm btn-outline--danger confirmationBtn" data-action="<?php echo e(route('admin.brand.delete', $brand->id)); ?>" data-question="<?php echo app('translator')->get('Are you sure to restore this brand?'); ?>"><i class="las la-trash-restore"></i><?php echo app('translator')->get('Restore'); ?>
                                                    </button>
                                                <?php endif; ?>
                                            </div>
                                        </td>
                                    </tr>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                                    <tr>
                                        <td class="text-muted text-center" colspan="100%"><?php echo e(__($emptyMessage)); ?></td>
                                    </tr>
                                <?php endif; ?>
                            </tbody>
                        </table>
                    </div>
                </div>

                <?php if($brands->hasPages()): ?>
                    <div class="card-footer py-4">
                        <?php echo e(paginateLinks($brands)); ?>

                    </div>
                <?php endif; ?>
            </div>
        </div>
    </div>

    <div id="cuModal" class="modal" tabindex="-1" role="dialog" aria-hidden="true">
        <div class="modal-dialog modal-xl modal-dialog-centered modal-dialog-scrollable" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title"><?php echo app('translator')->get('Add Brand'); ?></h5>
                    <button type="button" class="close" data-bs-dismiss="modal" aria-label="<?php echo app('translator')->get('Close'); ?>">
                        <i class="las la-times"></i>
                    </button>
                </div>
                <div class="modal-body">
                    <form action="<?php echo e(route('admin.brand.store')); ?>" method="POST" enctype="multipart/form-data" id="brandForm">
                        <?php echo csrf_field(); ?>

                        <div class="row">
                            <div class="col-xl-3 col-lg-4">
                                <label class="logo-label"><?php echo app('translator')->get('Logo'); ?></label>
                                <?php if (isset($component)) { $__componentOriginaldbcc027cdd3569f61821c56d10b77c01 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginaldbcc027cdd3569f61821c56d10b77c01 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.image-uploader','data' => ['class' => 'w-100','name' => 'image_input','type' => 'brand']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('image-uploader'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['class' => 'w-100','name' => 'image_input','type' => 'brand']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginaldbcc027cdd3569f61821c56d10b77c01)): ?>
<?php $attributes = $__attributesOriginaldbcc027cdd3569f61821c56d10b77c01; ?>
<?php unset($__attributesOriginaldbcc027cdd3569f61821c56d10b77c01); ?>
<?php endif; ?>
<?php if (isset($__componentOriginaldbcc027cdd3569f61821c56d10b77c01)): ?>
<?php $component = $__componentOriginaldbcc027cdd3569f61821c56d10b77c01; ?>
<?php unset($__componentOriginaldbcc027cdd3569f61821c56d10b77c01); ?>
<?php endif; ?>
                            </div>

                            <div class="col-xl-9 col-lg-8">
                                <div class="form-group row">
                                    <div class="col-lg-3 col-xl-2">
                                        <label><?php echo app('translator')->get('Name'); ?></label>
                                    </div>
                                    <div class="col-lg-9 col-xl-10">
                                        <input type="text" class="form-control" value="<?php echo e(old('name')); ?>" name="name" required />
                                    </div>
                                </div>

                                <div class="form-group row">
                                    <div class="col-lg-3 col-xl-2">
                                        <label><?php echo app('translator')->get('Is Featured'); ?></label>
                                    </div>
                                    <div class="col-lg-9 col-xl-10">
                                        <select name="is_featured" class="form-control">
                                            <option value="<?php echo e(Status::NO); ?>"><?php echo app('translator')->get('No'); ?></option>
                                            <option value="<?php echo e(Status::YES); ?>"><?php echo app('translator')->get('Yes'); ?></option>
                                        </select>
                                    </div>
                                </div>

                                <div class="form-group row">
                                    <div class="col-lg-3 col-xl-2">
                                        <label><?php echo app('translator')->get('Meta Title'); ?></label>
                                    </div>
                                    <div class="col-lg-9 col-xl-10">
                                        <input type="text" class="form-control" name="meta_title" value="<?php echo e(old('meta_title')); ?>">
                                    </div>
                                </div>

                                <div class="form-group row">
                                    <div class="col-lg-3 col-xl-2">
                                        <label><?php echo app('translator')->get('Meta Description'); ?></label>
                                    </div>
                                    <div class="col-lg-9 col-xl-10">
                                        <textarea name="meta_description" rows="5" class="form-control"><?php echo e(old('meta_description')); ?> </textarea>
                                    </div>
                                </div>

                                <div class="form-group row">
                                    <div class="col-lg-3 col-xl-2">
                                        <label><?php echo app('translator')->get('Meta Keywords'); ?></label>
                                    </div>
                                    <div class="col-lg-9 col-xl-10">
                                        <select name="meta_keywords[]" class="form-control select2-auto-tokenize" multiple="multiple"></select>
                                        <small class="form-text text-muted">
                                            <i class="las la-info-circle"></i>
                                            <?php echo app('translator')->get('Type , or hit enter to seperate keywords'); ?>
                                        </small>
                                    </div>
                                </div>
                            </div>

                        </div>

                    </form>
                </div>

                <div class="modal-footer">
                    <button type="submit" class="btn btn--primary w-100 h-45" form="brandForm"><?php echo app('translator')->get('Submit'); ?></button>
                </div>
            </div>
        </div>
    </div>

    <?php if (isset($component)) { $__componentOriginalbd5922df145d522b37bf664b524be380 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginalbd5922df145d522b37bf664b524be380 = $attributes; } ?>
<?php $component = App\View\Components\ConfirmationModal::resolve([] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('confirmation-modal'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\App\View\Components\ConfirmationModal::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginalbd5922df145d522b37bf664b524be380)): ?>
<?php $attributes = $__attributesOriginalbd5922df145d522b37bf664b524be380; ?>
<?php unset($__attributesOriginalbd5922df145d522b37bf664b524be380); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalbd5922df145d522b37bf664b524be380)): ?>
<?php $component = $__componentOriginalbd5922df145d522b37bf664b524be380; ?>
<?php unset($__componentOriginalbd5922df145d522b37bf664b524be380); ?>
<?php endif; ?>
<?php $__env->stopSection(); ?>

<?php $__env->startPush('breadcrumb-plugins'); ?>
    <div class="d-flex justify-content-end align-items-center flex-wrap gap-2 has-search-form">
        <div class="flex-grow-1">
            <?php if (isset($component)) { $__componentOriginale48b4598ffc2f41a085f001458a956d1 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginale48b4598ffc2f41a085f001458a956d1 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.search-form','data' => []] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('search-form'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?> <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginale48b4598ffc2f41a085f001458a956d1)): ?>
<?php $attributes = $__attributesOriginale48b4598ffc2f41a085f001458a956d1; ?>
<?php unset($__attributesOriginale48b4598ffc2f41a085f001458a956d1); ?>
<?php endif; ?>
<?php if (isset($__componentOriginale48b4598ffc2f41a085f001458a956d1)): ?>
<?php $component = $__componentOriginale48b4598ffc2f41a085f001458a956d1; ?>
<?php unset($__componentOriginale48b4598ffc2f41a085f001458a956d1); ?>
<?php endif; ?>
        </div>
        <?php if(!$trashed): ?>
            <!-- Modal Trigger Button -->
            <button type="button" class="btn btn-sm btn-outline--primary h-45 cuModalBtn flex-shrink-0 flex-grow-1 addBtn" data-modal_title="<?php echo app('translator')->get('Add New Brand'); ?>" data-default_image="<?php echo e(getImage(null, null)); ?>">
                <i class="las la-plus"></i><?php echo app('translator')->get('Add New'); ?>
            </button>

            <a href="<?php echo e(route('admin.brand.trashed')); ?>" class="btn btn-sm btn-outline--danger h-45 flex-shrink-0 flex-grow-1">
                <i class="las la-trash-restore-alt"></i><?php echo app('translator')->get('Trashed'); ?>
            </a>
        <?php else: ?>
            <?php if (isset($component)) { $__componentOriginal3b9bf6c313f6db4d5c9389e5666c89a5 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal3b9bf6c313f6db4d5c9389e5666c89a5 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.back','data' => ['route' => ''.e(route('admin.brand.all')).'']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('back'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['route' => ''.e(route('admin.brand.all')).'']); ?> <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal3b9bf6c313f6db4d5c9389e5666c89a5)): ?>
<?php $attributes = $__attributesOriginal3b9bf6c313f6db4d5c9389e5666c89a5; ?>
<?php unset($__attributesOriginal3b9bf6c313f6db4d5c9389e5666c89a5); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal3b9bf6c313f6db4d5c9389e5666c89a5)): ?>
<?php $component = $__componentOriginal3b9bf6c313f6db4d5c9389e5666c89a5; ?>
<?php unset($__componentOriginal3b9bf6c313f6db4d5c9389e5666c89a5); ?>
<?php endif; ?>
        <?php endif; ?>
    </div>
<?php $__env->stopPush(); ?>

<?php $__env->startPush('script'); ?>
    <script>
        'use strict';
        (function($) {

            $('#cuModal').on('shown.bs.modal', function(e) {
                $(document).off('focusin.modal');
            });

            $('.editBtn').on('click', function() {
                var modal = $('#cuModal');
                modal.find('.select2-auto-tokenize').empty();
                var brand = $(this).data('resource');
                modal.find('.logo-label').removeClass('required');
                $.each(brand.meta_keywords, function(i, item) {
                    modal.find('.select2-auto-tokenize').append($('<option>', {
                        value: item,
                        text: item,
                    }));
                });
                modal.find('.select2-auto-tokenize').val(brand.meta_keywords);
            });

            $('.change_status').on('change', function() {
                var id = $(this).data('id');

                var data = {
                    _token: `<?php echo e(csrf_token()); ?>`,
                };

                $.ajax({
                    url: `<?php echo e(route('admin.brand.status', '')); ?>/${$(this).data('id')}`,
                    method: 'POST',
                    data: data,
                    success: function(response) {
                        notify(response.status, response.message);
                    }
                });
            });

            $('.addBtn').on('click', function() {
                $('#cuModal').find('.logo-label').addClass('required');
            });


        })(jQuery);
    </script>
<?php $__env->stopPush(); ?>

<?php $__env->startPush('style'); ?>
    <style>
        .table-thumb {
            width: 75px;
            height: 50px;
        }

        @media (max-width: 991px) {
            .table-thumb {
                margin-left: auto;
            }
        }
    </style>
<?php $__env->stopPush(); ?>

<?php echo $__env->make('admin.layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/creativedesignbd/ecommerce7.creativedesign.com.bd/core/resources/views/admin/brand/index.blade.php ENDPATH**/ ?>