@include('admin.crud.form', [ 'action' => route('admin.videos.store', [$course->id, $unit->id]), 'formId' => 'add-video-form', 'submitText' => 'Save Video', 'class' => 'ajax-crud-form', 'redirect' => route('admin.course-content.index', $course->id), 'fields' => [ [ 'type' => 'hidden', 'name' => 'course_id', 'id' => 'course_id', 'value' => $course->id, 'label' => null, ], [ 'type' => 'hidden', 'name' => 'unit_id', 'id' => 'unit_id', 'value' => $unit->id ?? null, 'label' => ($course ? $course->title . ' > ' : '') . ($unit ? ($unit->parent ? $unit->parent->title. ' > ' : '') : '') . ($unit->title ?? 'None'), 'enabled' => $unit ? true : false, ], [ 'type' => 'text', 'name' => 'title', 'id' => 'title', 'label' => 'Video Title', 'placeholder' => 'Enter Video Title', 'required' => true, 'col' => 12 ], [ 'type' => 'textarea', 'name' => 'description', 'id' => 'description', 'label' => 'Video Description', 'placeholder' => 'Enter Video Description', 'required' => false, 'col' => 12 ], [ 'type' => 'select', 'name' => 'provider', 'id' => 'provider', 'label' => 'Video Provider', 'required' => true, 'options' => get_feature('video_options'), 'col' => 3 ], [ 'type' => 'text', 'name' => 'provider_id', 'id' => 'provider_id', 'label' => 'Video URL/ ID', 'placeholder' => 'Enter video URL/ID', 'required' => true, 'col' => 9, 'data-provider-dependent' => true ], [ 'type' => 'seperator', 'col' => 12 ], [ 'type' => 'number', 'name' => 'duration', 'id' => 'duration', 'label' => 'Duration (minutes)', 'placeholder' => 'Enter duration in minutes', 'min' => '0', 'col' => 4 ], [ 'type' => 'select', 'name' => 'status', 'id' => 'status', 'label' => 'Status', 'required' => true, 'options' => [ 'published' => 'Published', 'draft' => 'Draft', 'archived' => 'Archived' ], 'col' => 4 ], [ 'type' => 'select', 'name' => 'access_type', 'id' => 'access_type', 'label' => 'Access Type', 'required' => true, 'options' => [ 'paid' => 'Paid', 'free' => [ 'label' => $isParentPaid == true ? 'Free (Parent as paid)' : 'Free', 'readonly' => $isParentPaid ], ], 'value' => $unit != null ? ($isParentPaid == true ? 'paid' : 'free') : '', 'col' => 4 ], [ 'type' => 'image', 'name' => 'access_type', 'id' => 'thumbnail', 'label' => 'Thumbnail', 'presetKey' => 'course_materials_thumbnail', 'col' => 8 ] ] ])