@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | { |
| 16 | 16 | $query = Category::isActive(); |
| 17 | 17 | |
| 18 | - if (array_key_exists('select', $params) && is_array($params['select']) && ! empty($params['select'])) { |
|
| 18 | + if (array_key_exists('select', $params) && is_array($params['select']) && !empty($params['select'])) { |
|
| 19 | 19 | $query->select($params['select']); |
| 20 | 20 | } |
| 21 | 21 | |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | */ |
| 41 | 41 | public function show($slug, array $params = []) |
| 42 | 42 | { |
| 43 | - if (! array_key_exists('select', $params) || ! is_array($params['select']) || empty($params['select'])) { |
|
| 43 | + if (!array_key_exists('select', $params) || !is_array($params['select']) || empty($params['select'])) { |
|
| 44 | 44 | throw new Exception('Category show() must select at least one column.'); |
| 45 | 45 | } |
| 46 | 46 | |
@@ -50,9 +50,9 @@ discard block |
||
| 50 | 50 | ->firstOrFail(); |
| 51 | 51 | |
| 52 | 52 | if ($params['load_products']) { |
| 53 | - $category->load(['products' => function ($products) use ($category, $params) { |
|
| 54 | - if (! array_key_exists('products_select', $params) || |
|
| 55 | - ! is_array($params['products_select']) || |
|
| 53 | + $category->load(['products' => function($products) use ($category, $params) { |
|
| 54 | + if (!array_key_exists('products_select', $params) || |
|
| 55 | + !is_array($params['products_select']) || |
|
| 56 | 56 | empty($params['products_select'])) { |
| 57 | 57 | throw new Exception('Category show() products must select at least one column.'); |
| 58 | 58 | } |
@@ -63,8 +63,8 @@ discard block |
||
| 63 | 63 | |
| 64 | 64 | $products->select($params['products_select']); |
| 65 | 65 | |
| 66 | - if (! is_null($category->product_sort_column) && |
|
| 67 | - ! is_null($category->product_sort_direction)) { |
|
| 66 | + if (!is_null($category->product_sort_column) && |
|
| 67 | + !is_null($category->product_sort_direction)) { |
|
| 68 | 68 | $products->orderBy($category->product_sort_column, $category->product_sort_direction); |
| 69 | 69 | } |
| 70 | 70 | }]); |