init
This commit is contained in:
25
app/Api/Requests/DynamicRequest.php
Normal file
25
app/Api/Requests/DynamicRequest.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Api\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class DynamicRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'description' => 'required_without:pictures|max:255',
|
||||
'pictures' => 'required_without:description',
|
||||
];
|
||||
}
|
||||
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'description.required_without' => '文字或图片必须上传一个',
|
||||
'description.max' => '文字过多',
|
||||
'pictures.required_without' => '文字说明或图片必须上传一个',
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user