Skip to content
This repository has been archived by the owner on Aug 31, 2022. It is now read-only.

Commit

Permalink
Merge pull request #43 from kkamara/fix-products-filtering-when-db-st…
Browse files Browse the repository at this point in the history
…rict-mode-true

Fix products filtering when db strict mode true
  • Loading branch information
kkamara authored May 31, 2021
2 parents 439b394 + 7cc5d17 commit a9e9dd7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion app/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,9 @@ public function scopeGetProducts($query, $request)
break;
}

$query->orderBy('products.id', 'DESC')->distinct();
$query->orderBy('products.id', 'DESC')
->groupBy('products.id')
->distinct();

return $query;
}
Expand Down
2 changes: 1 addition & 1 deletion config/database.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
'collation' => 'utf8mb4_unicode_ci',
'prefix' => '',
'prefix_indexes' => true,
'strict' => false,
'strict' => true,
'engine' => null,
'options' => extension_loaded('pdo_mysql') ? array_filter([
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
Expand Down

0 comments on commit a9e9dd7

Please sign in to comment.