관리-도구
편집 파일: edit.blade.php
@extends('admin.master_layout') @section('title') <title>{{ __('Update Brand') }}</title> @endsection @section('admin-content') <div class="main-content"> <section class="section"> <div class="section-header"> <h1>{{ __('Update Brand') }}</h1> <div class="section-header-breadcrumb"> <div class="breadcrumb-item active"><a href="{{ route('admin.dashboard') }}">{{ __('Dashboard') }}</a> </div> <div class="breadcrumb-item active"><a href="{{ route('admin.course-category.index') }}">{{ __('Update Brand') }}</a> </div> <div class="breadcrumb-item">{{ __('Update brand') }}</div> </div> </div> <div class="section-body"> <div class="mt-4 row"> <div class="col-12"> <div class="card"> <div class="card-header d-flex justify-content-between"> <h4>{{ __('Update brand') }}</h4> <div> <a href="{{ route('admin.brand.index') }}" class="btn btn-primary"><i class="fa fa-arrow-left"></i>{{ __('Back') }}</a> </div> </div> <div class="card-body"> <form action="{{ route('admin.brand.update', $brand->id) }}" method="post" enctype="multipart/form-data"> @csrf @method('PUT') <div class="row"> <div class="col-md-12"> <div class="form-group"> <label for="name">{{ __('Name') }}<span class="text-danger">*</span></label> <input type="text" id="name" name="name" value="{{ $brand->name }}" placeholder="{{ __('Enter name') }}" class="form-control"> @error('name') <span class="text-danger">{{ $message }}</span> @enderror </div> </div> <div class="col-md-12"> <div class="form-group"> <label for="name">{{ __('Url') }}<span class="text-danger">*</span></label> <input type="text" id="url" name="url" value="{{ $brand->url }}" placeholder="{{ __('Enter url') }}" class="form-control"> @error('url') <span class="text-danger">{{ $message }}</span> @enderror </div> </div> <div class="col-md-12"> <div class="form-group"> <label>{{ __('Image') }}<span class="text-danger">*</span></label> <div id="image-preview" class="image-preview brand-bg"> <label for="image-upload" id="image-label">{{ __('Image') }}</label> <input type="file" name="image" id="image-upload"> </div> @error('image') <span class="text-danger">{{ $message }}</span> @enderror </div> </div> <div class="col-md-12"> <div class="form-group"> <label for="status">{{ __('Status') }}<span class="text-danger">*</span></label> <select class="form-control" name="status"> <option @selected($brand->status == 1) value="1">{{ __('Active') }}</option> <option @selected($brand->status == 0) value="0">{{ __('Inactive') }}</option> </select> @error('status') <span class="text-danger">{{ $message }}</span> @enderror </div> </div> <div class="text-center col-md-12"> <x-admin.save-button :text="__('Save')"> </x-admin.save-button> </div> </div> </form> </div> </div> </div> </div> </div> </section> </div> @endsection @push('js') <script src="{{ asset('backend/js/jquery.uploadPreview.min.js') }}"></script> <script> 'use strict'; $(document).ready(function() { $.uploadPreview({ input_field: "#image-upload", preview_box: "#image-preview", label_field: "#image-label", label_default: "{{ __('Choose Icon') }}", label_selected: "{{ __('Change Icon') }}", no_label: false, success_callback: null }); $('#image-preview').css({ 'background-image': 'url({{ asset($brand->image) }})', 'background-size': 'contain', 'background-position': 'center', 'background-repeat': 'no-repeat' }); }) </script> @endpush