{{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- --}}
@php $js_data = []; if ($case->link_case_with_form) { $linked_form_query = $case->link_case_with_form()->withoutGlobalScope('lean'); $linked_form = $linked_form_query->first(); if ($linked_form) { $last_record = $linked_form->all_linked_records()->last(); if ($last_record) { // Reload the record without scope only once $last_record_no_scope = $last_record->newQueryWithoutScopes()->find($last_record->id); $js_data = $last_record_no_scope?->raw_form; } else { $js_data = $linked_form->raw_form; } } } @endphp @if(!$case->link_case_with_form->form->allow_print_by_company_user) @endif