Файловый менеджер - Редактировать - /home/clickysoft/public_html/securebeans.clickysoft.net/resources/views/admin/productCategories/edit.blade.php
Назад
@extends('layouts.admin') @section('content') <div class="content"> <div class="row"> <div class="col-lg-12"> <div class="panel panel-default"> <div class="panel-heading"> {{ trans('global.edit') }} {{ trans('cruds.productCategory.title_singular') }} </div> <div class="panel-body"> <form method="POST" action="{{ route("admin.product-categories.update", [$productCategory->id]) }}" enctype="multipart/form-data"> @method('PUT') @csrf <div class="form-group {{ $errors->has('name') ? 'has-error' : '' }}"> <label class="required" for="name">{{ trans('cruds.productCategory.fields.name') }}</label> <input class="form-control" type="text" name="name" id="name" value="{{ old('name', $productCategory->name) }}" required> @if($errors->has('name')) <span class="help-block" role="alert">{{ $errors->first('name') }}</span> @endif <span class="help-block">{{ trans('cruds.productCategory.fields.name_helper') }}</span> </div> <div class="form-group {{ $errors->has('description') ? 'has-error' : '' }}"> <label for="description">{{ trans('cruds.productCategory.fields.description') }}</label> <textarea class="form-control" name="description" id="description">{{ old('description', $productCategory->description) }}</textarea> @if($errors->has('description')) <span class="help-block" role="alert">{{ $errors->first('description') }}</span> @endif <span class="help-block">{{ trans('cruds.productCategory.fields.description_helper') }}</span> </div> <div class="form-group {{ $errors->has('photo') ? 'has-error' : '' }}"> <label for="photo">{{ trans('cruds.productCategory.fields.photo') }}</label> <div class="needsclick dropzone" id="photo-dropzone"> </div> @if($errors->has('photo')) <span class="help-block" role="alert">{{ $errors->first('photo') }}</span> @endif <span class="help-block">{{ trans('cruds.productCategory.fields.photo_helper') }}</span> </div> <div class="form-group"> <button class="btn btn-danger" type="submit"> {{ trans('global.save') }} </button> </div> </form> </div> </div> </div> </div> </div> @endsection @section('scripts') <script> Dropzone.options.photoDropzone = { url: '{{ route('admin.product-categories.storeMedia') }}', maxFilesize: 2, // MB acceptedFiles: '.jpeg,.jpg,.png,.gif', maxFiles: 1, addRemoveLinks: true, headers: { 'X-CSRF-TOKEN': "{{ csrf_token() }}" }, params: { size: 2, width: 4096, height: 4096 }, success: function (file, response) { $('form').find('input[name="photo"]').remove() $('form').append('<input type="hidden" name="photo" value="' + response.name + '">') }, removedfile: function (file) { file.previewElement.remove() if (file.status !== 'error') { $('form').find('input[name="photo"]').remove() this.options.maxFiles = this.options.maxFiles + 1 } }, init: function () { @if(isset($productCategory) && $productCategory->photo) var file = {!! json_encode($productCategory->photo) !!} this.options.addedfile.call(this, file) this.options.thumbnail.call(this, file, file.preview) file.previewElement.classList.add('dz-complete') $('form').append('<input type="hidden" name="photo" value="' + file.file_name + '">') this.options.maxFiles = this.options.maxFiles - 1 @endif }, error: function (file, response) { if ($.type(response) === 'string') { var message = response //dropzone sends it's own error messages in string } else { var message = response.errors.file } file.previewElement.classList.add('dz-error') _ref = file.previewElement.querySelectorAll('[data-dz-errormessage]') _results = [] for (_i = 0, _len = _ref.length; _i < _len; _i++) { node = _ref[_i] _results.push(node.textContent = message) } return _results } } </script> @endsection
| ver. 1.4 |
Github
|
.
| PHP 8.1.29 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка