<?php $__env->startSection('title'); ?> <?php if(isset($pageTitle)): ?> <?php echo e($pageTitle); ?> <?php endif; ?> <?php $__env->stopSection(); ?>
<?php $__env->startSection('main-body'); ?>
    <!-- Start page title -->
    <div class="qz-page-title">
        <div class="container-fluid">
            <div class="row">
                <div class="col-12">
                    <div class="d-flex justify-content-between align-items-center">
                        <h2><?php echo e(isset($pageTitle) ? $pageTitle : ''); ?></h2>
                        <span class="sidebarToggler">
                            <i class="fa fa-bars d-lg-none d-block"></i>
                        </span>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- End page title -->
    <?php echo $__env->make('layout.message', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
    <!-- Start content area  -->
    <div class="qz-content-area">
        <div class="card add-category">
            <div class="card-body">
                <div class="container-fluid">
                    <div class="row">
                        <div class="col-md-12">
                            <?php echo e(Form::open(['route' => 'blogSave', 'files' => 'true'])); ?>

                            <div class="row">
                                <div class="col-md-12">
                                    <div class="form-group <?php echo e($errors->has('name') ? ' has-error' : ''); ?>">
                                        <label><?php echo e(__('Post Title')); ?><span class="text-danger">*</span></label>
                                        <input type="text" name="title" <?php if(isset($item)): ?> value="<?php echo e($item->title); ?>" <?php else: ?> value="<?php echo e(old('title')); ?>"
                                               <?php endif; ?> class="form-control" placeholder="<?php echo e(__('Post title')); ?>">
                                        <span class="text-danger"><strong><?php echo e($errors->first('title')); ?></strong></span>
                                    </div>
                                </div>
                                <div class="col-md-6">
                                    <div class="form-group">
                                        <label><?php echo e(__('Category')); ?><span class="text-danger">*</span></label>
                                        <div class="qz-question-category">
                                            <select name="category_id" class="form-control">
                                                <option value=""><?php echo e(__('Select')); ?></option>
                                                <?php if(isset($categories[0])): ?>
                                                    <?php $__currentLoopData = $categories; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                        <option <?php if(isset($item) && ($item->category_id == $key->id)): ?> selected <?php elseif((old('category_id') != null) && (old('category_id') == $key->id)): ?> <?php endif; ?> value="<?php echo e($key->id); ?>"><?php echo e($key->title); ?></option>
                                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                <?php endif; ?>
                                            </select>
                                        </div>
                                        <span class="text-danger"><strong><?php echo e($errors->first('category_id')); ?></strong></span>
                                    </div>
                                </div>
                                <div class="col-md-6">
                                    <div class="form-group">
                                        <label><?php echo e(__('Status')); ?><span class="text-danger">*</span></label>
                                        <div class="qz-question-category">
                                            <select name="status" class="form-control">
                                                <?php $__currentLoopData = status(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                    <option <?php if(isset($item) && ($item->status == $key)): ?> selected
                                                            <?php elseif((old('status') != null) && (old('status') == $key)): ?> <?php endif; ?> value="<?php echo e($key); ?>"><?php echo e($value); ?></option>
                                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                            </select>
                                        </div>
                                        <span class="text-danger"><strong><?php echo e($errors->first('status')); ?></strong></span>
                                    </div>
                                </div>
                                <div class="col-md-12">
                                    <div class="form-group">
                                        <label><?php echo e(__('Description')); ?><span class="text-danger">*</span></label>
                                        <textarea name="description" id="btEditor" rows="6" class="form-control"><?php if(isset($item)): ?><?php echo e($item->description); ?><?php else: ?><?php echo e(old('description')); ?><?php endif; ?></textarea>
                                        <span class="text-danger"><strong><?php echo e($errors->first('description')); ?></strong></span>
                                    </div>
                                </div>
                                <div class="col-md-5">
                                    <div class="form-group">
                                        <label><?php echo e(__('Thumbnail Image')); ?><span class="text-danger"></span></label>
                                        <div id="file-upload" class="section">
                                            <!--Default version-->
                                            <div class="row section">
                                                <div class="col s12 m12 l12">
                                                    <input name="image" type="file" id="input-file-now" class="dropify" data-default-file="<?php echo e(isset($item) && !empty($item->image) ? $item->image : ''); ?>" />
                                                    <?php if($errors->has('image')): ?>
                                                        <div class="text-danger"><?php echo e($errors->first('image')); ?></div>
                                                    <?php endif; ?>
                                                </div>
                                            </div>
                                            <!--Default value-->
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-md-3">
                                    <?php if(isset($item)): ?>
                                        <input type="hidden" name="edit_id" value="<?php echo e($item->id); ?>">
                                    <?php endif; ?>
                                    <button type="submit" class="btn btn-primary btn-block add-category-btn">
                                        <?php if(isset($item)): ?> <?php echo e(__('Update')); ?> <?php else: ?> <?php echo e(__('Add New')); ?> <?php endif; ?>
                                    </button>
                                </div>
                            </div>
                            <?php echo e(Form::close()); ?>

                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- End content area  -->
<?php $__env->stopSection(); ?>

<?php $__env->startSection('script'); ?>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layout.master', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /var/www/html/ayara/resources/views/admin/blog/add.blade.php ENDPATH**/ ?>