ldc-crm/resources/views/bo/partials/inputs/varchar-picture.blade.php
2025-08-07 17:40:37 +02:00

34 lines
1.7 KiB
PHP

{{--
VARIABLE || COMMENT || TYPE || REQUIRED || DEFAULT
$id || The id of the input tag. || string || REQUIRED ||
$name || The name of the input tag. || string || REQUIRED ||
$helper || The helper of the input. || string || REQUIRED ||
$width || The width of the picture. || integer || REQUIRED ||
$height || The name of the picture. || integer || REQUIRED ||
$required || Is the field required ? || boolean || OPTIONNAL || false
$preview || Is the picture previewed ? || boolean || OPTIONNAL || false
$browseEvent || Let false if you need to import
a picture || boolean || OPTIONNAL || false
$value || The default value of the input. || string || OPTIONNAL || ''
$model || The model we're creating/editing || Model class || OPTIONNAL || null
--}}
@php
$data = [
'id' => $id,
'name' => $name,
'helper' => __('crud.minicrud.dimensions_must_be', [
'widthpx' => "{$width}px",
'heightpx' => "{$height}px",
]),
'width' => $width,
'height' => $height,
'value' => $model->{$name} ?? ($value ?? ''),
'preview' => $preview ?? false,
'browseEvent' => $browseEvent ?? false,
'required' => $required ?? false,
];
@endphp
<div class="image-input" data-json='@json($data)'></div>
@include('modules.input-error', ['inputName' => $name, 'helper' => null])