@include('admin.crud.form', [ 'action' => route('admin.documents.update', $edit_data->id), 'method' => 'PUT', 'formId' => 'edit-documents-form', 'submitText' => 'Update Documents', 'class' => 'ajax-crud-form', 'redirect' => route('admin.documents.index'), 'fields' => [ [ 'type' => 'text', 'name' => 'title', 'id' => 'title', 'label' => 'Document Title', 'placeholder' => 'Enter Document Title', 'required' => true, 'value' => old('title',$edit_data->material->title), 'col' => 12 ], [ 'type' => 'textarea', 'name' => 'description', 'id' => 'description', 'label' => 'Document Description', 'placeholder' => 'Enter Document Description', 'required' => false, 'value' => old('description',$edit_data->material->description), 'col' => 12 ], [ 'type' => 'file', 'name' => 'file', 'id' => 'document_file', 'label' => 'Document File', 'presetKey' => 'documents_file', 'accept' => 'file/*', 'value' => $edit_data->file_url, 'col' => 12 ], [ 'type' => 'seperator', 'col' => 12 ], [ 'type' => 'select', 'name' => 'access_type', 'id' => 'access_type', 'label' => 'Access Type', 'required' => true, 'options' => [ 'paid' => 'Paid', 'free' => [ 'label' => $isParentPaid == true ? 'Free (Lession as paid)' : 'Free', 'readonly' => $isParentPaid ], ], 'value' => old('access_type',$edit_data->access_type), 'col' => 4 ], [ 'type' => 'image', 'name' => 'thumbnail', 'id' => 'thumbnail', 'label' => 'Thumbnail', 'presetKey' => 'course_materials_thumbnail', 'value' => ($edit_data->material->thumbnail) ? $edit_data->material->thumbnail_url : null, 'col' => 12 ] ] ])