Skip to content

Commit a56aba8

Browse files
authored
Merge pull request #57 from gaelenb/master
Add ability to set $asYouType property in config/scout.php
2 parents d6a54bc + 9f4faa4 commit a56aba8

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ In your `config/scout.php` add:
4848
'max_expansions' => 50,
4949
'distance' => 2
5050
],
51+
'asYouType' => false,
5152
],
5253
```
5354

src/TNTSearchScoutServiceProvider.php

+8
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ public function boot()
2525
$tnt->loadConfig($config);
2626
$tnt->setDatabaseHandle(app('db')->connection()->getPdo());
2727
$this->setFuzziness($tnt);
28+
$this->setAsYouType($tnt);
2829

2930
return new Engines\TNTSearchEngine($tnt);
3031
});
@@ -49,4 +50,11 @@ private function setFuzziness($tnt)
4950
$tnt->fuzzy_max_expansions = isset($max_expansions) ? $max_expansions : $tnt->fuzzy_max_expansions;
5051
$tnt->fuzzy_distance = isset($distance) ? $distance : $tnt->fuzzy_distance;
5152
}
53+
54+
private function setAsYouType($tnt)
55+
{
56+
$asYouType = config('scout.tntsearch.asYouType');
57+
58+
$tnt->asYouType = isset($asYouType) ? $asYouType : $tnt->asYouType;
59+
}
5260
}

0 commit comments

Comments
 (0)