mirror of
https://github.com/Bigherollc/wticreatorstudio.git
synced 2026-07-14 09:01:42 -04:00
45 lines
1.0 KiB
PHP
45 lines
1.0 KiB
PHP
<?php
|
|
|
|
namespace Modules\StudioPlus\Http\Controllers;
|
|
|
|
use Illuminate\Contracts\Support\Renderable;
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Routing\Controller;
|
|
use Modules\StudioPlus\Entities\Setting;
|
|
use Modules\StudioPlus\Http\Requests\SettingRequest;
|
|
use Modules\StudioPlus\Services\Settings;
|
|
|
|
class SettingController extends Controller
|
|
{
|
|
protected $service;
|
|
|
|
public function __construct()
|
|
{
|
|
$this->service = new Settings();
|
|
}
|
|
|
|
public function common()
|
|
{
|
|
return view('studioplus::setting.common');
|
|
}
|
|
|
|
public function getOption(Request $request)
|
|
{
|
|
$option = $this->service->getOption($request->key);
|
|
|
|
return response()->json([
|
|
'option' => $option,
|
|
]);
|
|
}
|
|
|
|
public function setOption(Request $request)
|
|
{
|
|
$option = $this->service->setOption($request->key, $request->value);
|
|
|
|
return response()->json([
|
|
'message' => __('studioplus::common.setting-updated'),
|
|
'option' => $option,
|
|
]);
|
|
}
|
|
}
|