@extends('user::_layouts.authenticated.layout') @section('title', __('messages.global.edit_supported_animals')) @section('content')
{{ __('messages.global.edit_supported_animals') }}
{{ csrf_field() }} {{-- Full Field --}}
full)) checked @endif>
@if ($errors->has('full')) {{ $errors->first('full') }} @endif
{{-- Content Field --}}
0 / 1000
@if ($errors->has('content')) {{ $errors->first('content') }} @endif
{{-- Supported Animals Field --}}
@php const ANIMAL_HIERARCHY = \Modules\Common\Entities\Animal::ANIMAL_SPECIES; function generateCheckboxes($items, $parentId = null) { $supportedAnimals = auth()->user()->organization->animalsManagement->supported_animals ?? []; $html = '
    '; foreach ($items as $key => $value) { $isCategory = is_array($value); $key = $isCategory ? $key : $value; $keyTrans = __("messages.animal_species.$key"); $checked = in_array($key, $supportedAnimals); $html .= '
  • '; $html .= '
    '; $html .= ''; $html .= ''; $html .= '
    '; if ($isCategory) { $html .= generateCheckboxes($value, $key); } $html .= '
  • '; } $html .= '
'; return $html; } @endphp {!! generateCheckboxes(ANIMAL_HIERARCHY) !!} @if ($errors->has('supported_animals')) {{ $errors->first('supported_animals') }} @endif
@endsection @section('js') @endsection