1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- <?php
- namespace App\Http\Requests;
- class ProductSaveRequest 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 [
- 'title' => 'required',
- 'remark' => 'nullable',
- 'href' => 'nullable'
- ];
- }
- public function attributes()
- {
- return [
- 'title' => '标题',
- 'remark' => '备注',
- 'href'=>'链接地址'
- ];
- }
- }
|