Файловый менеджер - Редактировать - /home/clickysoft/public_html/charliapp-v2.clickysoft.net/resources/views/admin/chats/edit.blade.php
Назад
@extends('layouts.admin') @section('content') <div class="card"> <div class="card-header"> {{ trans('global.edit') }} {{ trans('cruds.chat.title_singular') }} </div> <div class="card-body"> <form method="POST" action="{{ route("admin.chats.update", [$chat->id]) }}" enctype="multipart/form-data"> @method('PUT') @csrf <div class="form-group"> <label class="required" for="from_id">{{ trans('cruds.chat.fields.from') }}</label> <select class="form-control select2 {{ $errors->has('from') ? 'is-invalid' : '' }}" name="from_id" id="from_id" required> @foreach($froms as $id => $entry) <option value="{{ $id }}" {{ (old('from_id') ? old('from_id') : $chat->from->id ?? '') == $id ? 'selected' : '' }}>{{ $entry }}</option> @endforeach </select> @if($errors->has('from')) <div class="invalid-feedback"> {{ $errors->first('from') }} </div> @endif <span class="help-block">{{ trans('cruds.chat.fields.from_helper') }}</span> </div> <div class="form-group"> <label class="required" for="to_id">{{ trans('cruds.chat.fields.to') }}</label> <select class="form-control select2 {{ $errors->has('to') ? 'is-invalid' : '' }}" name="to_id" id="to_id" required> @foreach($tos as $id => $entry) <option value="{{ $id }}" {{ (old('to_id') ? old('to_id') : $chat->to->id ?? '') == $id ? 'selected' : '' }}>{{ $entry }}</option> @endforeach </select> @if($errors->has('to')) <div class="invalid-feedback"> {{ $errors->first('to') }} </div> @endif <span class="help-block">{{ trans('cruds.chat.fields.to_helper') }}</span> </div> <div class="form-group"> <label class="required" for="message">{{ trans('cruds.chat.fields.message') }}</label> <input class="form-control {{ $errors->has('message') ? 'is-invalid' : '' }}" type="text" name="message" id="message" value="{{ old('message', $chat->message) }}" required> @if($errors->has('message')) <div class="invalid-feedback"> {{ $errors->first('message') }} </div> @endif <span class="help-block">{{ trans('cruds.chat.fields.message_helper') }}</span> </div> <div class="form-group"> <label for="attachments">{{ trans('cruds.chat.fields.attachments') }}</label> <div class="needsclick dropzone {{ $errors->has('attachments') ? 'is-invalid' : '' }}" id="attachments-dropzone"> </div> @if($errors->has('attachments')) <div class="invalid-feedback"> {{ $errors->first('attachments') }} </div> @endif <span class="help-block">{{ trans('cruds.chat.fields.attachments_helper') }}</span> </div> <div class="form-group"> <label for="feature_type">{{ trans('cruds.chat.fields.feature_type') }}</label> <input class="form-control {{ $errors->has('feature_type') ? 'is-invalid' : '' }}" type="text" name="feature_type" id="feature_type" value="{{ old('feature_type', $chat->feature_type) }}"> @if($errors->has('feature_type')) <div class="invalid-feedback"> {{ $errors->first('feature_type') }} </div> @endif <span class="help-block">{{ trans('cruds.chat.fields.feature_type_helper') }}</span> </div> <div class="form-group"> <label for="feature">{{ trans('cruds.chat.fields.feature') }}</label> <input class="form-control {{ $errors->has('feature') ? 'is-invalid' : '' }}" type="number" name="feature" id="feature" value="{{ old('feature', $chat->feature) }}" step="1"> @if($errors->has('feature')) <div class="invalid-feedback"> {{ $errors->first('feature') }} </div> @endif <span class="help-block">{{ trans('cruds.chat.fields.feature_helper') }}</span> </div> <div class="form-group"> <button class="btn btn-danger" type="submit"> {{ trans('global.save') }} </button> </div> </form> </div> </div> @endsection @section('scripts') <script> var uploadedAttachmentsMap = {} Dropzone.options.attachmentsDropzone = { url: '{{ route('admin.chats.storeMedia') }}', maxFilesize: 5, // MB addRemoveLinks: true, headers: { 'X-CSRF-TOKEN': "{{ csrf_token() }}" }, params: { size: 5 }, success: function (file, response) { $('form').append('<input type="hidden" name="attachments[]" value="' + response.name + '">') uploadedAttachmentsMap[file.name] = response.name }, removedfile: function (file) { file.previewElement.remove() var name = '' if (typeof file.file_name !== 'undefined') { name = file.file_name } else { name = uploadedAttachmentsMap[file.name] } $('form').find('input[name="attachments[]"][value="' + name + '"]').remove() }, init: function () { @if(isset($chat) && $chat->attachments) var files = {!! json_encode($chat->attachments) !!} for (var i in files) { var file = files[i] this.options.addedfile.call(this, file) file.previewElement.classList.add('dz-complete') $('form').append('<input type="hidden" name="attachments[]" value="' + file.file_name + '">') } @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
|
Настройка