route('parking'))->id; $rules = [ 'name' => 'required|max:255|unique:parkings,name,'.$id, 'parking_fence' => 'required', 'area_id' => 'required', 'status' => 'required|boolean', 'max_number' => 'max:5', 'type' => '', // ]; if ($this->isMethod('put')) { $rules = Arr::only($rules, $this->keys()); } return $rules; } public function attributes() { return [ 'name' => '区域名称', 'parking_fence' => '停车区域', 'area_id' => '所属大区', 'type' => '区域类型', 'max_number' => '最大停车数', 'status' => '区域状态' ]; } }