ufutx.dma/app/Validators/ProjectValidator.php
2026-03-04 14:42:40 +08:00

39 lines
1.6 KiB
PHP

<?php
namespace App\Validators;
/**
* ESTP-项目验证器
*/
class ProjectValidator extends BaseValidator {
//验证规则
protected $rule =[
'name' =>'required',
'industry_id' =>'required|exists:estp_industries,id',
'investment_stage_id' =>'required|exists:estp_investment_stages,id',
'industry_position'=>'required',
'investment_highlights'=>'required',
'transaction_summary'=>'required',
'financial_data'=>'required',
'exit_strategy'=>'required',
];
//自定义验证信息
protected $message = [
'name.required' =>'请填写项目名称',
'industry_id.required' =>'请选择行业',
'industry_id.exists' =>'所选行业不存在',
'investment_stage_id.required' =>'请选择投资阶段',
'investment_stage_id.exists' =>'所选投资阶段不存在',
'industry_position.required' =>'请填写行业地位与投资要点',
'investment_highlights.required' =>'请填写投资要点',
'transaction_summary.required' =>'请填写交易概要',
'financial_data.required' =>'请填写财务数据',
'exit_strategy.exit_strategy' =>'请填写退出方式',
];
//自定义场景
protected $scene = [
'create' => ['name','industry_id','investment_stage_id','industry_position','investment_highlights','transaction_summary','financial_data','exit_strategy'],
'update' => ['name','industry_id','investment_stage_id','industry_position','investment_highlights','transaction_summary','financial_data','exit_strategy'],
];
}