| @@ -23,9 +23,8 @@ | ||
| 23 | 23 | |
| 24 | 24 | protected $searchable = ['title', 'description']; |
| 25 | 25 | |
| 26 | 26 | /** |
| 27 | - * Local scope to filter products by search/query string | |
| 28 | 27 | * @param ModelQueryBuilder $query |
| 29 | 28 | * @param string $search |
| 30 | 29 | * @return ModelQueryBuilder |
| 31 | 30 | */ |
| @@ -46,9 +45,8 @@ | ||
| 46 | 45 | return $query; |
| 47 | 46 | } |
| 48 | 47 | |
| 49 | 48 | /** |
| 50 | - * Local scope to order products alphabetically by title | |
| 51 | 49 | * @param $query |
| 52 | 50 | * @return mixed |
| 53 | 51 | */ |
| 54 | 52 | public function scopeOrderedByTitle($query) |
| @@ -56,9 +54,8 @@ | ||
| 56 | 54 | return $query->orderBy('title', 'ASC'); |
| 57 | 55 | } |
| 58 | 56 | |
| 59 | 57 | /** |
| 60 | - * This `getProducts` method will return the list of products | |
| 61 | 58 | * @param string $search |
| 62 | 59 | * @return array |
| 63 | 60 | */ |
| 64 | 61 | public function getProducts ( $search ) |
| @@ -68,9 +65,8 @@ | ||
| 68 | 65 | ]; |
| 69 | 66 | } |
| 70 | 67 | |
| 71 | 68 | /** |
| 72 | - * This `getProduct` method will get product by id and return | |
| 73 | 69 | * @param int $productId |
| 74 | 70 | * @return array |
| 75 | 71 | */ |
| 76 | 72 | public function getProduct ( $productId ) |
| @@ -80,9 +76,8 @@ | ||
| 80 | 76 | ]; |
| 81 | 77 | } |
| 82 | 78 | |
| 83 | 79 | /** |
| 84 | - * This `createProduct` method will create a new product | |
| 85 | 80 | * @param array $data |
| 86 | 81 | * @return array |
| 87 | 82 | */ |
| 88 | 83 | public function createProduct ( $data ) |
| @@ -96,9 +91,8 @@ | ||
| 96 | 91 | ]; |
| 97 | 92 | } |
| 98 | 93 | |
| 99 | 94 | /** |
| 100 | - * This `updateProduct` method will update an exiting product by id | |
| 101 | 95 | * @param int $productId |
| 102 | 96 | * @param array $data |
| 103 | 97 | * @return array |
| 104 | 98 | */ |
| @@ -115,9 +109,8 @@ | ||
| 115 | 109 | ]; |
| 116 | 110 | } |
| 117 | 111 | |
| 118 | 112 | /** |
| 119 | - * This `deleteProduct` method will delete an exiting product by id | |
| 120 | 113 | * @param int $productId |
| 121 | 114 | * @return array |
| 122 | 115 | */ |
| 123 | 116 | public function deleteProduct ( $productId ) |