%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /var/www/html/evablog/storage/framework/views/
Upload File :
Create Path :
Current File : /var/www/html/evablog/storage/framework/views/3dc6ad25421af1e528680ad4a819e5fd18aad689.php

<?php $__env->startSection('content'); ?>
    <div class="categories-container">
        <div class="row">
            <div class="col-sm-12">
                <form class="needs-validation <?php echo e($errors->count() > 0 ? 'was-validated' : ''); ?>"
                      method="POST" autocomplete="off" action="<?php echo e(route('dashboard.categories.createOrUpdate', $id)); ?>"
                      enctype="multipart/form-data" novalidate>
                    <?php echo e(csrf_field()); ?>


                    <div class="form-group row">
                        <label for="name" class="col-sm-2 col-form-label">Name</label>
                        <div class="col-sm-10">
                            <input id="name" type="text" name="name" placeholder="Name"
                                   class="form-control <?php echo e($errors->has('name') ? 'is-invalid' : 'is-valid'); ?>"
                                   value="<?php echo e($category->name); ?>" required>
                            <?php if($errors->has('name')): ?>
                                <div class="invalid-feedback">
                                    <?php echo e($errors->first('name')); ?>

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

                    <div class="form-group row">
                        <label for="media" class="col-sm-2 col-form-label">Image</label>
                        <div class="col-sm-10">
                            <div class="input-group">
                                <div class="custom-file">
                                    <input type="file" class="custom-file-input" id="media" name="media"
                                           accept="image/*" onchange="fileChanged(this)">
                                    <label class="custom-file-label" id="media-input-label" for="media">Choose
                                        file</label>
                                </div>
                            </div>
                            <?php if($errors->has('media')): ?>
                                <div class="invalid-feedback">
                                    <?php echo e($errors->first('media')); ?>

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

                    <div class="form-group row">
                        <div class="col-md-6 offset-md-2">
                            <img class="img-fluid" id="image-preview"
                                 src="<?php echo e($category->media()->first() ? $category->media()->first()->getUrl() : ''); ?>"/>
                        </div>
                    </div>

                    <div class="form-group row">
                        <div class="col-sm-8 offset-sm-2">
                            <button type="submit" class="btn btn-outline-primary">Save</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('script'); ?>
    <script>
        function fileChanged (input) {
            if (input.files && input.files[0]) {
                var reader = new FileReader();
                reader.onload = function (e) {
                    $('#image-preview').attr('src', e.target.result);
                    $('#media-input-label').text(input.files[0].name);
                };
                reader.readAsDataURL(input.files[0]);
            }
        }
    </script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.app', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>

Zerion Mini Shell 1.0