@php $statModules = $statModules ?? collect(); $statModuleInstances = $statModuleInstances ?? collect(); $metricDefinitions = data_get($type, 'metricDefinitions', collect()); $metricRows = old('metric_definitions'); if ($metricRows === null) { $metricRows = collect($metricDefinitions)->map(fn ($definition) => [ 'id' => data_get($definition, 'id'), 'name' => data_get($definition, 'name'), 'label' => data_get($definition, 'label'), 'unit' => data_get($definition, 'unit', ''), 'is_required' => (bool) data_get($definition, 'is_required'), 'sort_order' => data_get($definition, 'sort_order', 0), ])->values()->all(); } if ($metricRows === []) { $metricRows = [ ['id' => null, 'name' => '', 'label' => '', 'unit' => '', 'is_required' => false, 'sort_order' => 10], ]; } $statModuleOptions = $statModules ->map(fn ($module) => [ 'id' => (string) data_get($module, 'id'), 'code' => (string) data_get($module, 'code'), 'render_type' => (string) data_get($module, 'render_type'), 'requires_metric' => (bool) data_get($module, 'requires_metric'), ]) ->values(); @endphp

{{ __('Configuration') }}

{{ __('Modifier un type') }}

{{ __('Retour types') }}
@if (session('status'))
{{ session('status') }}
@endif
@csrf @method('PUT')

{{ __('Métriques') }}

{{ __('Champs à renseigner') }}

{{ __('Annuler') }}

{{ __('Configuration') }}

{{ __('Statistiques et graphiques') }}

{{ trans_choice('ui.common.modules', $statModuleInstances->count(), ['count' => $statModuleInstances->count()]) }}
@csrf
@forelse ($statModuleInstances as $instance) @php $instanceConfig = data_get($instance, 'config_json', []) ?? []; $instanceModuleId = (string) data_get($instance, 'stat_module_id'); @endphp
@csrf @method('PUT')
@empty
{{ __('Aucun module statistique configuré pour ce type.') }}
@endforelse