Changeset View
Changeset View
Standalone View
Standalone View
src/app/Providers/AppServiceProvider.php
Show All 38 Lines | private static function serializeSQLBindings(array $array, string $sql): string | ||||
return $entry; | return $entry; | ||||
}, $array); | }, $array); | ||||
return implode(', ', $serialized); | return implode(', ', $serialized); | ||||
} | } | ||||
/** | /** | ||||
* Load the override config and apply it | |||||
* | |||||
* To use create a config/override.php file, and add values including the toplevel config name. | |||||
* E.g. To override the 'uri' value in imap.php, set ['imap' => ['uri' => 'overrideValue']] in config/override.php. | |||||
* | |||||
* @return void | |||||
*/ | |||||
private function applyOverrideConfig() | |||||
{ | |||||
$overrideConfig = $this->app['config']->get('override', []); | |||||
foreach (array_keys($overrideConfig) as $key) { | |||||
$config = $this->app['config']->get($key, []); | |||||
$this->app['config']->set($key, array_merge($config, $overrideConfig[$key])); | |||||
} | |||||
} | |||||
/** | |||||
* Bootstrap any application services. | * Bootstrap any application services. | ||||
* | * | ||||
* @return void | * @return void | ||||
*/ | */ | ||||
public function boot() | public function boot() | ||||
{ | { | ||||
\App\Domain::observe(\App\Observers\DomainObserver::class); | \App\Domain::observe(\App\Observers\DomainObserver::class); | ||||
\App\Entitlement::observe(\App\Observers\EntitlementObserver::class); | \App\Entitlement::observe(\App\Observers\EntitlementObserver::class); | ||||
▲ Show 20 Lines • Show All 109 Lines • ▼ Show 20 Lines | public function boot() | ||||
default: | default: | ||||
$search = '%' . $search . '%'; | $search = '%' . $search . '%'; | ||||
} | } | ||||
/** @var Builder $this */ | /** @var Builder $this */ | ||||
return $this->where($column, 'like', $search); | return $this->where($column, 'like', $search); | ||||
} | } | ||||
); | ); | ||||
$this->applyOverrideConfig(); | |||||
} | } | ||||
} | } |