diff --git a/app/Http/Requests/Bo/UpdateMiniCrudRequest.php b/app/Http/Requests/Bo/UpdateMiniCrudRequest.php index 6f0351d..ac3d1d0 100644 --- a/app/Http/Requests/Bo/UpdateMiniCrudRequest.php +++ b/app/Http/Requests/Bo/UpdateMiniCrudRequest.php @@ -102,8 +102,8 @@ abstract class UpdateMiniCrudRequest extends FormRequest $sizes = (object)[ 'minHeight' => $dim['height'], 'maxHeight' => $dim['height'], - 'minWith' => $dim['width'], - 'maxWith' => $dim['width'], + 'minWidth' => $dim['width'], + 'maxWidth' => $dim['width'], ]; $rules = array_merge($rules, [ "data.$iptName.value" => [ diff --git a/app/Lib/Helpers/FileStorageHelper.php b/app/Lib/Helpers/FileStorageHelper.php index 08a9f8c..22ddf64 100644 --- a/app/Lib/Helpers/FileStorageHelper.php +++ b/app/Lib/Helpers/FileStorageHelper.php @@ -465,4 +465,22 @@ class FileStorageHelper $filename = trim($filename, '.-'); return $filename; } + + /** + * Remove all model files for the given Model. + * + * @param Model $model + * @return void + */ + public static function removeModelFiles(Model $model): void + { + $tableName = $model::query()->getModel()->getTable(); + + if (!empty(Storage::disk('public')->allFiles("modelfiles/{$tableName}"))) { + Storage::disk('public')->deleteDirectory("modelfiles/{$tableName}"); + } + if (!empty(Storage::disk('private')->allFiles("modelfiles/{$tableName}"))) { + Storage::disk('private')->deleteDirectory("modelfiles/{$tableName}"); + } + } } diff --git a/app/Lib/Helpers/ToolboxHelper.php b/app/Lib/Helpers/ToolboxHelper.php index 3bdc70c..17db496 100644 --- a/app/Lib/Helpers/ToolboxHelper.php +++ b/app/Lib/Helpers/ToolboxHelper.php @@ -480,7 +480,7 @@ class ToolboxHelper $xMessage = trans(":attribute la largeur doit être de {$sizes->minWidth}px"); } $yMessage = trans( - ":attribute la hauteur doit être comprise entre {$sizes->minWidth}px et {$sizes->maxWidth}px" + ":attribute la hauteur doit être comprise entre {$sizes->minHeight}px et {$sizes->maxHeight}px" ); if ($sizes->minHeight === $sizes->maxHeight) { $yMessage = trans(":attribute la hauteur doit être de {$sizes->minHeight}px"); diff --git a/resources/lang/fr/crud.php b/resources/lang/fr/crud.php index fd8cd62..8aa5dc7 100644 --- a/resources/lang/fr/crud.php +++ b/resources/lang/fr/crud.php @@ -55,7 +55,7 @@ return [ 'minicrud' => [ 'visibility_label' => 'Visibilité', - 'visibility_helper' => 'Vérifier qu\'il est visible.', + 'visibility_helper' => 'Cocher pour rendre visible.', 'enum_select' => 'Sélectionnez :enum dans la liste.', 'associated_enum' => 'Associé :enum', 'dimensions_must_be' => 'Doit être :widthpx (largeur) par :heightpx (hauteur).', diff --git a/resources/ts/bo/components/SelectMultipleEnumComponent.vue b/resources/ts/bo/components/SelectMultipleEnumComponent.vue new file mode 100644 index 0000000..28ed00f --- /dev/null +++ b/resources/ts/bo/components/SelectMultipleEnumComponent.vue @@ -0,0 +1,276 @@ + + + + + {{ intLabel }} {{ intRequire ? "*" : "" }} + + + + + + + {{ + parseValidationInput( + `${intName}[${String(index)}][name]`, + intAllErrors + ) + }} + + + + {{ intHelper }} + + + + {{ intSpecificItem.label }} + + + {{ parseValidationInput(`${intSpecificItem.name}`, intAllErrors) }} + + + {{ intSpecificItem.helper }} + + + + + + + diff --git a/resources/views/bo/partials/inputs/pivot-belongsToMany.blade.php b/resources/views/bo/partials/inputs/pivot-belongsToMany.blade.php index 2a13441..ecf9e68 100644 --- a/resources/views/bo/partials/inputs/pivot-belongsToMany.blade.php +++ b/resources/views/bo/partials/inputs/pivot-belongsToMany.blade.php @@ -18,7 +18,7 @@ } $data = [ 'name' => $name, - 'value' => Arr::wrap($value), + 'value' => old($name, $model->{$name} ?? []) ?? [], 'placeholder' => $placeholder, 'itemsList' => $itemsList, 'itemLimit' => $itemLimit ?? null,
+ {{ + parseValidationInput( + `${intName}[${String(index)}][name]`, + intAllErrors + ) + }} +
+ {{ parseValidationInput(`${intSpecificItem.name}`, intAllErrors) }} +