user()->can('create', Product::class); } public function rules() { //when updating you need to ignore the column ID return [ 'product_key' => 'unique:products,product_key,'.$this->product->id.',id,company_id,'.auth()->user()->companyId(), 'cost' => 'numeric', 'price' => 'numeric', 'qty' => 'numeric', ]; } }