public function rules()
{
$rules = [
'comment' => 'max:2000',
'source' => 'different:target',
'file1' => 'required_without_all:file2,file3|between:1,15360|mimes:txt,pdf',
'file2' => 'required_without_all:file1,file3|between:1,15360|mimes:txt,pdf',
'file3' => 'required_without_all:file1,file2|between:1,15360|mimes:txt,pdf',
];
if ($this->entity_id)
{
$rules['file1'] = 'between:1,15360|mimes:txt,pdf';
$rules['file2'] = 'between:1,15360|mimes:txt,pdf';
$rules['file3'] = 'between:1,15360|mimes:txt,pdf';
}
return $rules;
}
Replace entity id by the name of the url parameter identifying the model you are updating. If it is a post, with post_id in the url, use $this->post_id.