*/ public function rules(): array { // 플러그인 식별자로부터 기준 경로 구성 (플러그인 루트) $identifier = $this->route('identifier'); $basePath = base_path("plugins/{$identifier}"); return [ 'identifier' => ['required', 'string'], 'path' => [ 'required', 'string', new SafePluginPath($basePath), new AllowedPluginFileType(), ], ]; } /** * 검증을 위한 데이터 준비 */ protected function prepareForValidation(): void { // 라우트 파라미터를 검증 데이터에 병합 $this->merge([ 'identifier' => $this->route('identifier'), 'path' => $this->route('path'), ]); } /** * 검증 오류 메시지 커스터마이징 * * @return array */ public function messages(): array { return [ 'identifier.required' => __('validation.asset.identifier.required'), 'identifier.string' => __('validation.asset.identifier.string'), 'path.required' => __('validation.asset.path.required'), 'path.string' => __('validation.asset.path.string'), ]; } }