@php
//Config:
//(UniqueCheckOperation needed.)
//name: required
//type: 'unique_text'
//check_fields:required, array
//check_fields.{field_name}.api_url:required, router name (use as check dulpicate, the router is set in UniqueCheckOperation, but you can use other api when needed)
//other_wheres:array
//check_fields.{field_name}:text or array, (use when other default filter needed, e.g. unit_id)
////show_if_exist:(when it is duplicate, what data will show in help-block, id as default)
//url_if_exist:(when it is set, this url will use in the msg (in help block))
//the structure should look like:
//
// [
// 'name' => 'programme_cname_unique_check',
// 'type' => 'unique_text',
// 'tab' => 'basic_info',
// 'check_fields' => [
// 'programme_cname' => [
// 'api_url' => 'programme_plan.check_unique',
// ],
// ],
// 'other_wheres' => [
// 'unit_id'=> $this->crud->getCurrentEntry()->unit_id,
// 'status' => ProgrammePlan::STATUS_ACTIVES
// ],
// 'show_if_exist' => 'programme_plan_no',
// 'url_if_exist' => 'programme_plan.edit'
// ]
$_class = get_class($crud->model);
$class = str_replace('\\', '\\\\',$_class);
$self_id = $crud->getCurrentEntryId();
@endphp
@push('crud_fields_styles')
@endpush
@push('crud_fields_scripts')
@endpush
{{-- Note: you can use @if ($crud->checkIfFieldIsFirstOfItsType($field, $fields)) to only load some CSS/JS once, even though there are multiple instances of it --}}