@extends('admin.layouts.app') @section('title', get_setting('site_name').' | '.($form ? __('Edit form') : __('New form'))) @section('content') @php $rows = old('kpis'); if (! is_array($rows)) { $rows = $form ? $form->formKpis->map(fn ($fk) => [ 'kpi_indicator_id' => $fk->kpi_indicator_id, 'weightage' => $fk->weightage, 'smart_specific' => $fk->smart_specific, 'smart_measurable' => $fk->smart_measurable, 'smart_achievable' => $fk->smart_achievable, 'smart_relevant' => $fk->smart_relevant, 'smart_timebound' => $fk->smart_timebound, ])->toArray() : []; } if (count($rows) === 0) { $rows[] = ['kpi_indicator_id' => '', 'weightage' => '', 'smart_specific' => '', 'smart_measurable' => '', 'smart_achievable' => '', 'smart_relevant' => '', 'smart_timebound' => '']; } $kpiOptions = $kpisLibrary->map(fn ($lib) => [ 'id' => $lib->id, 'label' => ($lib->title_bn ? $lib->title_bn.' — ' : '').$lib->title, ])->values(); @endphp