*/ public function rules(): array { $maxKilobytes = (int) (CustomAssetService::MAX_UPLOAD_BYTES / 1024); $rules = [ 'file' => [ 'required', 'file', 'max:'.$maxKilobytes, 'mimes:'.implode(',', AllowedTemplateFileType::getAllowedExtensions()), ], // 하위 디렉토리는 선택 — 없으면 `custom/` 바로 아래에 놓인다. 'directory' => ['nullable', 'string', 'max:200', new SafeCustomAssetPath], ]; return HookManager::applyFilters('core.extension_custom_asset.upload_validation_rules', $rules, $this); } /** * 검증 메시지 * * @return array */ public function messages(): array { return [ 'file.required' => __('custom_assets.validation.file_required'), 'file.file' => __('custom_assets.validation.file_invalid'), 'file.mimes' => __('custom_assets.validation.file_mimes', [ 'allowed' => implode(', ', AllowedTemplateFileType::getAllowedExtensions()), ]), 'file.max' => __('custom_assets.errors.upload_too_large', [ 'limit' => (string) CustomAssetService::MAX_UPLOAD_BYTES, ]), ]; } }