| @@ -8,9 +8,8 @@ | ||
| 8 | 8 | |
| 9 | 9 | class ProductController extends Controller |
| 10 | 10 | { |
| 11 | 11 | /** |
| 12 | - * index method will return the list of product | |
| 13 | 12 | * @param Request $request |
| 14 | 13 | * @param Product $product |
| 15 | 14 | * @return array |
| 16 | 15 | */ |
| @@ -19,9 +18,8 @@ | ||
| 19 | 18 | return $product->getProducts( $request->getSafe('search', 'sanitize_text_field') ); |
| 20 | 19 | } |
| 21 | 20 | |
| 22 | 21 | /** |
| 23 | - * get method will get product by id and return | |
| 24 | 22 | * @param Product $product |
| 25 | 23 | * @param int $product_id |
| 26 | 24 | * @return array |
| 27 | 25 | */ |
| @@ -30,10 +28,9 @@ | ||
| 30 | 28 | return $product->getProduct( $product_id ); |
| 31 | 29 | } |
| 32 | 30 | |
| 33 | 31 | /** |
| 34 | - * creare method will create new product | |
| 35 | - * @param Request $request | |
| 32 | + * @param ProductRequest $request | |
| 36 | 33 | * @param Product $product |
| 37 | 34 | * @return array |
| 38 | 35 | * @throws \FluentSupport\Framework\Validator\ValidationException |
| 39 | 36 | */ |
| @@ -45,10 +42,9 @@ | ||
| 45 | 42 | } |
| 46 | 43 | |
| 47 | 44 | |
| 48 | 45 | /** |
| 49 | - * update methd will update an exiting product by id | |
| 50 | - * @param Request $request | |
| 46 | + * @param ProductRequest $request | |
| 51 | 47 | * @param Product $product |
| 52 | 48 | * @param int $product_id |
| 53 | 49 | * @return array |
| 54 | 50 | * @throws \FluentSupport\Framework\Validator\ValidationException |
| @@ -60,9 +56,8 @@ | ||
| 60 | 56 | return $product->updateProduct( $product_id, $data ); |
| 61 | 57 | } |
| 62 | 58 | |
| 63 | 59 | /** |
| 64 | - * delete method will delete an existing product by id | |
| 65 | 60 | * @param Product $product |
| 66 | 61 | * @param int $product_id |
| 67 | 62 | * @return array |
| 68 | 63 | */ |