/** * @param Request $request * * @return array */ public function rules(Request $request) : array { return ProductOption::validationRules((int) $request->route('productId'), (int) $request->route('optionId')); }
/** * @return array */ public function rules() : array { return array_merge(ProductOption::validationRules((int) $this->request->get('option-product')), ['option-product' => 'required|int|exists:products,id']); }