@include('admin.crud.form', [ 'action' => route('admin.courses.update', $edit_data->id), 'method' => 'PUT', 'formId' => 'edit-course-form', 'submitText' => 'Update Course', 'class' => 'ajax-crud-form', 'redirect' => route('admin.courses.index'), 'fields' => [ [ 'type' => 'text', 'name' => 'title', 'id' => 'title', 'label' => 'Course Title', 'placeholder' => 'Enter Course Title', 'required' => true, 'value' => old('title', $edit_data->title), 'col' => 12 ], [ 'type' => 'text', 'name' => 'slug', 'id' => 'slug', 'label' => 'Slug', 'placeholder' => 'Enter Course Slug (auto-generated if empty)', 'value' => old('slug', $edit_data->slug), 'col' => 12 ], [ 'type' => 'textarea', 'name' => 'description', 'id' => 'description', 'label' => 'Description', 'placeholder' => 'Enter Course Description', 'value' => old('description', $edit_data->description), 'col' => 12 ], [ 'type' => 'select2', 'name' => 'program_id', 'id' => 'program_id', 'label' => 'Program', 'options' => ['' => 'Select Program'] + $programs, 'value' => old('program_id', $edit_data->program_id), 'col' => 6, 'enabled' => has_feature('programs') ], [ 'type' => 'select2', 'name' => 'category_id', 'id' => 'category_id', 'label' => 'Category', 'options' => ['' => 'Select Category'] + $categories, 'value' => old('category_id', $edit_data->category_id), 'col' => 6, 'enabled' => has_feature('categories') ], [ 'type' => 'select', 'name' => 'type', 'id' => 'type', 'label' => 'Course Type', 'required' => true, 'options' => [ 'structured' => 'Structured (with lessons/units)', 'direct' => 'Direct (single content)' ], 'value' => old('type', $edit_data->type), 'col' => 6 ], [ 'type' => 'select', 'name' => 'status', 'id' => 'status', 'label' => 'Status', 'required' => true, 'options' => [ 'draft' => 'Draft', 'published' => 'Published', 'archived' => 'Archived' ], 'value' => old('status', $edit_data->status), 'col' => 4 ], [ 'type' => 'seperator', 'col' => 12 ], [ 'type' => 'image', 'name' => 'thumbnail', 'label' => 'Thumbnail', 'accept' => 'image/*', 'presetKey' => 'courses_thumbnail', 'subPreset' => 'original', 'value' => is_array($edit_data->thumbnail) ? ($edit_data->thumbnail_url['thumb']) : '', 'col' => 8 ], [ 'type' => 'image', 'name' => 'banner_image', 'label' => 'Banner Image', 'accept' => 'image/*', 'presetKey' => 'courses_banner', 'value' => $edit_data->banner_image_url, 'col' => 8 ], [ 'type' => 'file', 'name' => 'banner_video', 'id' => 'banner_video', 'label' => 'Banner Video', 'accept' => 'video/*', 'value' => $edit_data->banner_video_url, 'col' => 8 ] ] ])