Skip to content

Commit e4868c5

Browse files
committed
Fix customer mysql search #40 (#44)
1 parent bfadc32 commit e4868c5

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
55

66
## [Unreleased]
77

8+
### Fixes
9+
10+
- Added check on customers for when using MySQL search driver to prevent undefined columns [#40](https://github.com/getcandy/getcandy/issues/40)
11+
812
### Changed
913

1014
- Changed `https` to `http` on country import due to issues with local environment CA installations.

src/Models/Customer.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ protected static function newFactory(): CustomerFactory
4545
*/
4646
public function toSearchableArray()
4747
{
48+
if (config('scout.driver') == 'mysql') {
49+
return $this->only(array_keys($this->getAttributes()));
50+
}
51+
4852
$metaFields = config('getcandy-hub.customers.searchable_meta', []);
4953

5054
$data = [

0 commit comments

Comments
 (0)