38 lines
847 B
PHP
38 lines
847 B
PHP
<?php
|
|
|
|
namespace App\Providers;
|
|
|
|
use App\Support\Setting;
|
|
use Illuminate\Support\ServiceProvider;
|
|
use Illuminate\Contracts\Foundation\Application;
|
|
|
|
class SettingServiceProvider extends ServiceProvider
|
|
{
|
|
/**
|
|
* Register services.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function register()
|
|
{
|
|
$this->app->scoped(Setting::class, function (Application $app) {
|
|
return new Setting();
|
|
});
|
|
|
|
}
|
|
|
|
/**
|
|
* Bootstrap services.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function boot()
|
|
{
|
|
// dpl keeps its existing environment and database settings.
|
|
if (\App\Support\SiteProfile::isHn()) {
|
|
config(['app.name' => config('site.name'), 'app.full_name' => config('site.full_name')]);
|
|
}
|
|
// App URL is forced per-request via middleware (Octane-safe).
|
|
}
|
|
}
|