table.',sort,'.$id.',id,tpid,'.$tpid; } else { $sort_val = 'required|unique:'.$this->table.',sort,null,null,tpid,'.$tpid; } if ($advType->width && $advType->height) { $image_val = 'dimensions:width='.$advType->width.',height='.$advType->height; } else { $image_val = ''; } return [ 'name' => 'required|max:50', 'sort' => $sort_val, 'image' => $image_val, 'href' => 'nullable|max:255', ]; } }