@extends('backend.layouts.app') @section('title', __('labels.backend.courses.title').' | '.app_name()) @section('content') {!! Form::model($course, ['method' => 'PUT', 'route' => ['admin.courses.update', $course->id], 'files' => true,]) !!}

@lang('labels.backend.courses.edit')

@if (Auth::user()->isAdmin())
{!! Form::label('teachers',trans('labels.backend.courses.fields.teachers'), ['class' => 'control-label']) !!} {!! Form::select('teachers[]', $teachers, old('teachers') ? old('teachers') : $course->teachers->pluck('id')->toArray(), ['class' => 'form-control select2', 'multiple' => 'multiple']) !!}
@endif
{!! Form::label('category_id',trans('labels.backend.courses.fields.category'), ['class' => 'control-label']) !!} {!! Form::select('category_id', $categories, old('category_id'), ['class' => 'form-control select2 js-example-placeholder-single', 'multiple' => false]) !!}
{!! Form::label('title', trans('labels.backend.courses.fields.title').' *', ['class' => 'control-label']) !!} {!! Form::text('title', old('title'), ['class' => 'form-control', 'placeholder' => '', 'required' => '']) !!}
{!! Form::label('slug', trans('labels.backend.courses.fields.slug'), ['class' => 'control-label']) !!} {!! Form::text('slug', old('slug'), ['class' => 'form-control', 'placeholder' => trans('labels.backend.courses.slug_placeholder')]) !!}
{!! Form::label('description',trans('labels.backend.courses.fields.description'), ['class' => 'control-label']) !!} {!! Form::textarea('description', old('description'), ['class' => 'form-control ', 'placeholder' => trans('labels.backend.courses.fields.description')]) !!}
{!! Form::label('price', trans('labels.backend.courses.fields.price').' (in '.$appCurrency["symbol"].')', ['class' => 'control-label']) !!} {!! Form::number('price', old('price'), ['class' => 'form-control', 'placeholder' => trans('labels.backend.courses.fields.price') ,'pattern' => "[0-9]"]) !!}
{!! Form::label('course_image', trans('labels.backend.courses.fields.course_image'), ['class' => 'control-label','accept' => 'image/jpeg,image/gif,image/png']) !!} {!! Form::file('course_image', ['class' => 'form-control']) !!} {!! Form::hidden('course_image_max_size', 8) !!} {!! Form::hidden('course_image_max_width', 4000) !!} {!! Form::hidden('course_image_max_height', 4000) !!} @if ($course->course_image) @endif
{!! Form::label('start_date', trans('labels.backend.courses.fields.start_date').' (yyyy-mm-dd)', ['class' => 'control-label']) !!} {!! Form::text('start_date', old('start_date'), ['class' => 'form-control date', 'pattern' => '(?:19|20)[0-9]{2}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-9])|(?:(?!02)(?:0[1-9]|1[0-2])-(?:30))|(?:(?:0[13578]|1[02])-31))', 'placeholder' => trans('labels.backend.courses.fields.start_date').' (Ex . 2019-01-01)']) !!}

@if($errors->has('start_date'))

{{ $errors->first('start_date') }}

@endif
{!! Form::label('add_video', trans('labels.backend.lessons.fields.add_video'), ['class' => 'control-label']) !!} {!! Form::select('media_type', ['youtube' => 'Youtube','vimeo' => 'Vimeo','upload' => 'Upload','embed' => 'Embed'],($course->mediavideo) ? $course->mediavideo->type : null,['class' => 'form-control', 'placeholder' => 'Select One','id'=>'media_type' ]) !!} {!! Form::text('video', ($course->mediavideo) ? $course->mediavideo->url : null, ['class' => 'form-control mt-3 d-none', 'placeholder' => trans('labels.backend.lessons.enter_video_url'),'id'=>'video' ]) !!} {!! Form::file('video_file', ['class' => 'form-control mt-3 d-none', 'placeholder' => trans('labels.backend.lessons.enter_video_url'),'id'=>'video_file','accept' =>'video/mp4' ]) !!} @if($course->mediavideo != null) @endif @if($course->mediavideo && ($course->mediavideo->type == 'upload')) @endif @lang('labels.backend.lessons.video_guide')
{!! Form::hidden('published', 0) !!} {!! Form::checkbox('published', 1, old('published'), []) !!} {!! Form::label('published', trans('labels.backend.courses.fields.published'), ['class' => 'checkbox control-label font-weight-bold']) !!}
{!! Form::hidden('featured', 0) !!} {!! Form::checkbox('featured', 1, old('featured'), []) !!} {!! Form::label('featured', trans('labels.backend.courses.fields.featured'), ['class' => 'checkbox control-label font-weight-bold']) !!}
{!! Form::hidden('trending', 0) !!} {!! Form::checkbox('trending', 1, old('trending'), []) !!} {!! Form::label('trending', trans('labels.backend.courses.fields.trending'), ['class' => 'checkbox control-label font-weight-bold']) !!}
{!! Form::hidden('popular', 0) !!} {!! Form::checkbox('popular', 1, old('popular'), []) !!} {!! Form::label('popular', trans('labels.backend.courses.fields.popular'), ['class' => 'checkbox control-label font-weight-bold']) !!}
{!! Form::hidden('free', 0) !!} {!! Form::checkbox('free', 1, old('free'), []) !!} {!! Form::label('free', trans('labels.backend.courses.fields.free'), ['class' => 'checkbox control-label font-weight-bold']) !!}
{!! Form::label('meta_title',trans('labels.backend.courses.fields.meta_title'), ['class' => 'control-label']) !!} {!! Form::text('meta_title', old('meta_title'), ['class' => 'form-control', 'placeholder' => trans('labels.backend.courses.fields.meta_title')]) !!}
{!! Form::label('meta_description',trans('labels.backend.courses.fields.meta_description'), ['class' => 'control-label']) !!} {!! Form::textarea('meta_description', old('meta_description'), ['class' => 'form-control', 'placeholder' => trans('labels.backend.courses.fields.meta_description')]) !!}
{!! Form::label('meta_keywords',trans('labels.backend.courses.fields.meta_keywords'), ['class' => 'control-label']) !!} {!! Form::textarea('meta_keywords', old('meta_keywords'), ['class' => 'form-control', 'placeholder' => trans('labels.backend.courses.fields.meta_keywords')]) !!}
{!! Form::submit(trans('strings.backend.general.app_update'), ['class' => 'btn btn-danger']) !!}
{!! Form::close() !!} @stop @push('after-scripts') @endpush