{{ $name }}
@if($type){{ $type }}@endif @if(!$required)
optional@endif
@if(($isInput ?? true) && empty($hasChildren))
@php
$isList = Str::endsWith($type, '[]');
$isPassword = preg_match('/password/', $name);
$fullName = str_replace('[]', '.0', $name);
$baseType = $isList ? substr($type, 0, -2) : $type;
// Ignore the first '[]': the frontend will take care of it
while (\Str::endsWith($baseType, '[]')) {
$fullName .= '.0';
$baseType = substr($baseType, 0, -2);
}
switch($baseType) {
case 'number':
case 'integer':
$inputType = 'number';
break;
case 'file':
$inputType = 'file';
break;
default:
$inputType = 'text';
}
@endphp
@if($type === 'boolean')
@elseif($isList)
@else
@endif
@endif
{!! $description !!}