mirror of https://github.com/kcal-app/kcal.git
Use `config` instead of `env` for Scout driver checks
This commit is contained in:
parent
6dc3d8a9e1
commit
4a273d7731
|
|
@ -21,7 +21,7 @@ class IngredientPickerController extends Controller
|
||||||
$results = new Collection();
|
$results = new Collection();
|
||||||
$term = $request->query->get('term');
|
$term = $request->query->get('term');
|
||||||
if (!empty($term)) {
|
if (!empty($term)) {
|
||||||
$results = match (env('SCOUT_DRIVER')) {
|
$results = match (config('scout.driver')) {
|
||||||
'algolia' => $this->searchWithAlgolia($term),
|
'algolia' => $this->searchWithAlgolia($term),
|
||||||
'elastic' => $this->searchWithElasticSearch($term),
|
'elastic' => $this->searchWithElasticSearch($term),
|
||||||
default => $this->searchWithDatabaseLike($term),
|
default => $this->searchWithDatabaseLike($term),
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ class AppServiceProvider extends ServiceProvider
|
||||||
{
|
{
|
||||||
LaravelJsonApi::defaultApi('v1');
|
LaravelJsonApi::defaultApi('v1');
|
||||||
|
|
||||||
if (env('SCOUT_DRIVER') === 'algolia') {
|
if (config('scout.driver') === 'algolia') {
|
||||||
Ingredient::bootSearchable();
|
Ingredient::bootSearchable();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
@if(env('SCOUT_DRIVER') === 'algolia')
|
@if(config('scout.driver') === 'algolia')
|
||||||
<div class="flex justify-center pt-12 sm:pt-0 sm:justify-start">
|
<div class="flex justify-center pt-12 sm:pt-0 sm:justify-start">
|
||||||
<a href="https://www.algolia.com/" target="_blank">
|
<a href="https://www.algolia.com/" target="_blank">
|
||||||
<img src="{{ asset('images/search-by-algolia-light-background.svg') }}" alt="Search by Algolia">
|
<img src="{{ asset('images/search-by-algolia-light-background.svg') }}" alt="Search by Algolia">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue