1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- <?php
- namespace App\Http\Requests\School;
- use App\Http\Requests\Request;
- class AssetSaveRequest extends Request
- {
- /**
- * Determine if the user is authorized to make this request.
- *
- * @return bool
- */
- public function authorize()
- {
- return true;
- }
- /**
- * Get the validation rules that apply to the request.
- *
- * @return array
- */
- public function rules()
- {
- if (!$this->ajax()) {
- return [];
- }
- return [
- 'type_id' => 'required',
- 'original_name' => 'required',
- 'file_url' => 'required',
- 'describe' => 'nullable'
- ];
- }
- public function attributes()
- {
- return [
- 'type_id' => '资源类型',
- 'original_name' => '原始文件名',
- 'file_url' => '文件地址',
- 'describe' => '描述'
- ];
- }
- }
|