v7.0.0 release
This commit is contained in:
1 parent
0e7fa04b03
commit
c4ea9a6cd1
3582 files changed
+626189
-160151
No files matched your search
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\TemplateCustomTranslation;
|
||||
|
||||
use App\Extension\HookManager;
|
||||
use App\Models\TemplateCustomTranslation;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
/**
|
||||
* 커스텀 다국어 키 일괄 삭제 요청 검증.
|
||||
*
|
||||
* 레이아웃 편집기 다국어 관리 모달의 "선택 삭제"/"미사용 전체 삭제" 에서
|
||||
* 호출됩니다. 권한은 라우트 permission 미들웨어(core.templates.layouts.edit)
|
||||
* 에서 처리합니다.
|
||||
*/
|
||||
class BulkDestroyCustomTranslationRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* 권한은 미들웨어 체인에서 처리합니다.
|
||||
*
|
||||
* @return bool 항상 true
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 검증 규칙
|
||||
*
|
||||
* @return array<string, mixed> 검증 규칙
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
$rules = [
|
||||
'ids' => ['required', 'array', 'min:1'],
|
||||
'ids.*' => ['integer', Rule::exists(TemplateCustomTranslation::class, 'id')],
|
||||
];
|
||||
|
||||
return HookManager::applyFilters('core.custom_translation.bulk_destroy_validation_rules', $rules, $this);
|
||||
}
|
||||
|
||||
/**
|
||||
* 검증 실패 메시지
|
||||
*
|
||||
* @return array<string, string> 메시지 맵
|
||||
*/
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'ids.required' => __('validation.custom_translation.ids.required'),
|
||||
'ids.array' => __('validation.custom_translation.ids.array'),
|
||||
'ids.min' => __('validation.custom_translation.ids.min'),
|
||||
'ids.*.integer' => __('validation.custom_translation.ids.integer'),
|
||||
'ids.*.exists' => __('validation.custom_translation.ids.exists'),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\TemplateCustomTranslation;
|
||||
|
||||
use App\Extension\HookManager;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
/**
|
||||
* 커스텀 다국어 키 목록 조회 요청 검증.
|
||||
*
|
||||
* 권한은 라우트 permission 미들웨어(core.templates.layouts.edit)에서 처리합니다.
|
||||
*/
|
||||
class IndexCustomTranslationRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* 권한은 미들웨어 체인에서 처리합니다.
|
||||
*
|
||||
* @return bool 항상 true
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 검증 규칙
|
||||
*
|
||||
* @return array<string, mixed> 검증 규칙
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
$rules = [
|
||||
'layout_name' => ['sometimes', 'nullable', 'string', 'max:150'],
|
||||
'status' => ['sometimes', 'nullable', 'in:active,orphaned'],
|
||||
];
|
||||
|
||||
return HookManager::applyFilters('core.custom_translation.index_validation_rules', $rules, $this);
|
||||
}
|
||||
|
||||
/**
|
||||
* 검증 실패 메시지
|
||||
*
|
||||
* @return array<string, string> 메시지 맵
|
||||
*/
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'layout_name.string' => __('validation.custom_translation.layout_name.string'),
|
||||
'layout_name.max' => __('validation.custom_translation.layout_name.max', ['max' => 150]),
|
||||
'status.in' => __('validation.custom_translation.status.in'),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\TemplateCustomTranslation;
|
||||
|
||||
use App\Extension\HookManager;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
/**
|
||||
* 커스텀 다국어 키 생성 요청 검증.
|
||||
*
|
||||
* 인라인 편집 확정 시 평문을 동적 다국어 키로 전환할 때 호출됩니다.
|
||||
* 키(`custom.{layout}.{seq}`)는 Service 가 자동 생성하므로 클라이언트는
|
||||
* 출처 레이아웃·편집 로케일·입력값만 전달합니다.
|
||||
*
|
||||
* 권한은 라우트 permission 미들웨어(core.templates.layouts.edit)에서 처리합니다.
|
||||
*/
|
||||
class StoreCustomTranslationRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* 권한은 미들웨어 체인에서 처리합니다.
|
||||
*
|
||||
* @return bool 항상 true
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 검증 규칙
|
||||
*
|
||||
* @return array<string, mixed> 검증 규칙
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
$rules = [
|
||||
'layout_name' => ['required', 'string', 'max:150'],
|
||||
'locale' => ['required', 'string', 'max:35'],
|
||||
'value' => ['required', 'string'],
|
||||
];
|
||||
|
||||
return HookManager::applyFilters('core.custom_translation.store_validation_rules', $rules, $this);
|
||||
}
|
||||
|
||||
/**
|
||||
* 검증 실패 메시지
|
||||
*
|
||||
* @return array<string, string> 메시지 맵
|
||||
*/
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'layout_name.required' => __('validation.custom_translation.layout_name.required'),
|
||||
'layout_name.string' => __('validation.custom_translation.layout_name.string'),
|
||||
'layout_name.max' => __('validation.custom_translation.layout_name.max', ['max' => 150]),
|
||||
'locale.required' => __('validation.custom_translation.locale.required'),
|
||||
'locale.string' => __('validation.custom_translation.locale.string'),
|
||||
'value.required' => __('validation.custom_translation.value.required'),
|
||||
'value.string' => __('validation.custom_translation.value.string'),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\TemplateCustomTranslation;
|
||||
|
||||
use App\Extension\HookManager;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
/**
|
||||
* 커스텀 다국어 키 수정 요청 검증.
|
||||
*
|
||||
* 속성 편집 모달 번역 탭에서 로케일별 값을 일괄 편집할 때 호출됩니다.
|
||||
* 낙관적 잠금을 위해 `expected_lock_version` 이 필수이며,
|
||||
* 현재 DB 버전과 불일치 시 Service 가 409 Conflict 를 던집니다.
|
||||
*
|
||||
* 권한은 라우트 permission 미들웨어(core.templates.layouts.edit)에서 처리합니다.
|
||||
*/
|
||||
class UpdateCustomTranslationRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* 권한은 미들웨어 체인에서 처리합니다.
|
||||
*
|
||||
* @return bool 항상 true
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 검증 규칙
|
||||
*
|
||||
* @return array<string, mixed> 검증 규칙
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
$rules = [
|
||||
'values' => ['required', 'array'],
|
||||
'values.*' => ['nullable', 'string'],
|
||||
'expected_lock_version' => ['required', 'integer', 'min:0'],
|
||||
];
|
||||
|
||||
return HookManager::applyFilters('core.custom_translation.update_validation_rules', $rules, $this);
|
||||
}
|
||||
|
||||
/**
|
||||
* 검증 실패 메시지
|
||||
*
|
||||
* @return array<string, string> 메시지 맵
|
||||
*/
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'values.required' => __('validation.custom_translation.values.required'),
|
||||
'values.array' => __('validation.custom_translation.values.array'),
|
||||
'expected_lock_version.required' => __('validation.custom_translation.expected_lock_version.required'),
|
||||
'expected_lock_version.integer' => __('validation.custom_translation.expected_lock_version.integer'),
|
||||
'expected_lock_version.min' => __('validation.custom_translation.expected_lock_version.min'),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user