@extends('layouts.admin-layout') @section('title') Add Categories @endsection @section('content')

Add Categories

@csrf
@php // Check if **any section has consultation_type_id null** $showSectionLabel = $category->sections->contains(function($section) { return is_null($section->consultation_type_id); }); @endphp
{{-- Consultation Type Select --}}
{{-- Section Label (Checkbox Flow) --}} {{-- Section Label (Consultation Type Flow) --}} {{-- Dynamic Form Container --}}
@foreach($category->sections as $section)
{{ $section->title }} @if(!empty($section->consultationType->type_name)) {{ strtoupper($section->consultationType->type_name ?? '' )}} @endif
{{-- Hidden Inputs --}}
@include('admin.includes.question-tree', [ 'questions' => $section->questions, 'section' => $section ])
@endforeach
@endsection @section('script') @endsection