mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-08-08 21:44:32 +02:00
Refactor Options to a Setting service bound with the service container
This commit is contained in:
@ -2,18 +2,35 @@
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Classes\Options;
|
||||
use App\Services\SettingServiceInterface;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
class SinglePageController extends Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* The Settings Service instance.
|
||||
*/
|
||||
protected SettingServiceInterface $settingService;
|
||||
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
*/
|
||||
public function __construct(SettingServiceInterface $SettingServiceInterface)
|
||||
{
|
||||
$this->settingService = $SettingServiceInterface;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* return the main view
|
||||
* @return view
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
return view('landing')->with('appSettings', Options::get()->toJson());
|
||||
return view('landing')->with('appSettings', $this->settingService->all()->toJson());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user