Set SettingService behind a Facade

This commit is contained in:
Bubka
2022-07-30 17:51:02 +02:00
parent be632bb489
commit f7ac1e96c3
21 changed files with 101 additions and 208 deletions

View File

@ -2,27 +2,12 @@
namespace App\Http\Controllers;
use App\Services\SettingService;
use App\Facades\Settings;
use Illuminate\Support\Facades\App;
class SinglePageController extends Controller
{
/**
* The Settings Service instance.
*/
protected SettingService $settingService;
/**
* Create a new controller instance.
*
*/
public function __construct(SettingService $settingService)
{
$this->settingService = $settingService;
}
/**
* return the main view
@ -31,7 +16,7 @@ class SinglePageController extends Controller
public function index()
{
return view('landing')->with([
'appSettings' => $this->settingService->all()->toJson(),
'appSettings' => Settings::all()->toJson(),
'appConfig' => collect([
'proxyAuth' => config("auth.defaults.guard") === 'reverse-proxy-guard' ? true : false,
'proxyLogoutUrl' => config("2fauth.config.proxyLogoutUrl") ? config("2fauth.config.proxyLogoutUrl") : false,