@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | */ |
| 14 | 14 | public function get(array $params = []) |
| 15 | 15 | { |
| 16 | - if (! array_key_exists('select', $params) || ! is_array($params['select']) || empty($params['select'])) { |
|
| 16 | + if (!array_key_exists('select', $params) || !is_array($params['select']) || empty($params['select'])) { |
|
| 17 | 17 | throw new Exception('Categories get() must select at least one column.'); |
| 18 | 18 | } |
| 19 | 19 | |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | */ |
| 43 | 43 | public function show($slug, array $params = []) |
| 44 | 44 | { |
| 45 | - if (! array_key_exists('select', $params) || ! is_array($params['select']) || empty($params['select'])) { |
|
| 45 | + if (!array_key_exists('select', $params) || !is_array($params['select']) || empty($params['select'])) { |
|
| 46 | 46 | throw new Exception('Category show() must select at least one column.'); |
| 47 | 47 | } |
| 48 | 48 | |
@@ -53,16 +53,16 @@ discard block |
||
| 53 | 53 | |
| 54 | 54 | if ($params['load_products']) { |
| 55 | 55 | $category->load(['products' => function($products) use ($category, $params) { |
| 56 | - if (! array_key_exists('products_select', $params) || |
|
| 57 | - ! is_array($params['products_select']) || |
|
| 56 | + if (!array_key_exists('products_select', $params) || |
|
| 57 | + !is_array($params['products_select']) || |
|
| 58 | 58 | empty($params['products_select'])) { |
| 59 | 59 | throw new Exception('Category show() products must select at least one column.'); |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | $products->select($params['products_select']); |
| 63 | 63 | |
| 64 | - if (! is_null($category->product_sort_column) && |
|
| 65 | - ! is_null($category->product_sort_direction)) { |
|
| 64 | + if (!is_null($category->product_sort_column) && |
|
| 65 | + !is_null($category->product_sort_direction)) { |
|
| 66 | 66 | $products->orderBy($category->product_sort_column, $category->product_sort_direction); |
| 67 | 67 | } |
| 68 | 68 | }]); |