You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
96 lines
2.1 KiB
PHP
96 lines
2.1 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Admin;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use App\Libs\TraitSetting;
|
|
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Http\JsonResponse;
|
|
use Illuminate\Contracts\View\View;
|
|
|
|
class SettingController extends Controller
|
|
{
|
|
use TraitSetting;
|
|
|
|
protected $breadcrumbs = [
|
|
['title' => '사이트 설정', 'link' => '/cms/setting']
|
|
];
|
|
|
|
// Page Header
|
|
protected $page = [
|
|
'code' => 'cms.setting',
|
|
'title' => '사이트 설정',
|
|
'icon' => 'fa-cog',
|
|
'description' => '사이트에서 사용되는 설정값들을 관리합니다.',
|
|
'link' => '/cms/setting'
|
|
];
|
|
|
|
/**
|
|
* 설정변수 목록
|
|
*
|
|
* @Verb : GET
|
|
* @Path : /cms/setting
|
|
* @param Request $request
|
|
* @return View
|
|
*/
|
|
public function index(Request $request)
|
|
{
|
|
$this->page['subTitle'] = $this->page['title'];
|
|
|
|
$data = $this->getSettingList($request);
|
|
|
|
return $this->setView('admin.setting.index', $data);
|
|
}
|
|
|
|
/**
|
|
* 설정변수 등록
|
|
*
|
|
* @Verb : GET
|
|
* @Path : /cms/setting/create
|
|
* @param Request $request
|
|
* @return JsonResponse
|
|
*/
|
|
public function create(Request $request)
|
|
{
|
|
$data = $this->createSetting($request);
|
|
|
|
$result = [
|
|
'mode' => $data->mode,
|
|
'data' => $data
|
|
];
|
|
|
|
return $this->sendJson('', 'success', $result);
|
|
}
|
|
|
|
/**
|
|
* 설정변수 저장
|
|
*
|
|
* @Verb : POST
|
|
* @Path : /cms/setting/store
|
|
* @param Request $request
|
|
* @return JsonResponse
|
|
*/
|
|
public function store(Request $request)
|
|
{
|
|
$result = $this->storeSetting($request);
|
|
|
|
return $this->sendJson($result['message'], $result['code']);
|
|
}
|
|
|
|
/**
|
|
* 설정변수 삭제
|
|
*
|
|
* Verb : POST
|
|
* Path : /cms/setting/delete
|
|
* @param Request $request
|
|
* @return JsonResponse
|
|
*/
|
|
public function delete(Request $request)
|
|
{
|
|
$result = $this->deleteSetting($request);
|
|
|
|
return $this->sendJson($result['message'], $result['code']);
|
|
}
|
|
}
|