1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- <?php
- namespace App\Http\Requests;
- use Illuminate\Foundation\Http\FormRequest;
- class BoxBindingRequest extends FormRequest
- {
- /**
- * 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()
- {
- $id = (int)optional($this->route('box'))->id;
- return [
- //
- 'box_no' => 'required|unique:box_binding,box_no,' . $id,
- 'batch' => 'required',
- 'device_xing' => 'required',
- 'imei_no' => '',
- 'iccid_no' => '',
- 'sim_no' => '',
- 'imsi_no' => '',
- ];
- }
- public function attributes()
- {
- return [
- 'batch' => '批次',
- 'box_no' => '控制设备编号',
- 'device_xing' => '中控型号',
- ];
- }
- }
|