UploadReportRequest.php
765 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
namespace App\Http\Container\AppSection\Requests;
use Hikoon\LaravelApi\Support\ApiRequest;
use Illuminate\Support\Facades\Auth;
class UploadReportRequest extends ApiRequest
{
/**
* @return void
*/
protected function prepareForValidation(): void
{
$this->merge(['user_id' => (int)Auth::id()]);
}
/**
* @return string[]
*/
public function rules(): array
{
return [
'name' => 'required|string',
'url' => 'required|url'
];
}
/**
* @return string[]
*/
public function messages(): array
{
return [
'name.required' => '请输入原文件名',
'url.required' => '请输入链接地址'
];
}
}