Files
Xboard/app/Providers/SettingServiceProvider.php

38 lines
719 B
PHP
Raw Normal View History

2023-11-17 14:44:01 +08:00
<?php
namespace App\Providers;
use App\Support\Setting;
use Illuminate\Support\Facades\URL;
2023-11-17 14:44:01 +08:00
use Illuminate\Support\ServiceProvider;
use Illuminate\Contracts\Foundation\Application;
use Illuminate\Support\Facades\Log;
2023-11-17 14:44:01 +08:00
class SettingServiceProvider extends ServiceProvider
{
/**
* Register services.
*
* @return void
*/
public function register()
{
2025-01-21 14:57:54 +08:00
$this->app->scoped(Setting::class, function (Application $app) {
return new Setting();
2023-11-17 14:44:01 +08:00
});
2023-11-17 14:44:01 +08:00
}
/**
* Bootstrap services.
*
* @return void
*/
public function boot()
{
if ($appUrl = admin_setting('app_url')) {
URL::forceRootUrl($appUrl);
}
2023-11-17 14:44:01 +08:00
}
}