'require|min:3', 'cover_img|商品图' => 'require', 'price|价格' => 'require|min:0', 'product_id|商品' => 'require|array|length:2', ]; public function isBatch() { $this->rule['product_id|商品'] = 'require|integer'; return $this; } }