| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- <?php
- namespace App\Http\Controllers\Admin\Config\Register;
- use Illuminate\Http\Request;
- use App\Http\Controllers\Controller;
- use App\Models\Config;
- class BasicController extends Controller
- {
- private Config $configModel;
- public function __construct(Config $config)
- {
- $this->configModel = $config;
- }
- /**
- * 기본
- * @method GET
- * @see /admin/config/register/basic
- */
- public function index()
- {
- return view('admin.config.register.basic', []);
- }
- /**
- * 기본 저장
- * @method POST
- * @see /admin/config/register/basic
- */
- public function store(Request $request)
- {
- $rules = [
- 'use_register_block' => 'numeric|nullable',
- 'use_register_email_auth' => 'numeric|nullable',
- 'password_min_length' => 'numeric|nullable',
- 'password_uppercase_length' => 'numeric|nullable',
- 'password_numbers_length' => 'numeric|nullable',
- 'password_specialchars_length' => 'numeric|nullable',
- 'use_user_thumb' => 'numeric|nullable',
- 'user_thumb_width' => 'numeric|nullable',
- 'user_thumb_height' => 'numeric|nullable',
- 'use_user_icon' => 'numeric|nullable',
- 'user_icon_width' => 'numeric|nullable',
- 'user_icon_height' => 'numeric|nullable',
- 'denied_nickname_list' => 'string|nullable',
- 'denied_userid_list' => 'string|nullable',
- 'denied_email_list' => 'string|nullable',
- 'user_register_policy1' => 'string|nullable',
- 'user_register_policy2' => 'string|nullable'
- ];
- $attributes = [
- 'use_register_block' => '회원가입 차단',
- 'use_register_email_auth' => '회원가입시 메일 인증 사용',
- 'password_min_length' => '비밀번호 보안수준 - 비밀번호 최소',
- 'password_uppercase_length' => '비밀번호 보안수준 - 대문자',
- 'password_numbers_length' => '비밀번호 보안수준 - 숫자',
- 'password_specialchars_length' => '비밀번호 보안수준 - 특수문자',
- 'use_user_thumb' => '회원 프로필 사진',
- 'user_thumb_width' => '회원 프로필 - 가로 길이',
- 'user_thumb_height' => '회원 프로필 - 세로 길이',
- 'use_user_icon' => '회원 아이콘',
- 'user_icon_width' => '회원 아이콘 - 가로 길이',
- 'user_icon_height' => '회원 아이콘 - 세로 길이',
- 'denied_nickname_list' => '금지 이름',
- 'denied_userid_list' => '금지 ID',
- 'denied_email_list' => '금지 E-mail',
- 'user_register_policy1' => '회원가입약관',
- 'user_register_policy2' => '개인정보취급방침'
- ];
- $posts = $this->validate($request, $rules, [], $attributes);
- $posts['use_register_block'] ??= '0';
- $posts['use_register_email_auth'] ??= '0';
- $posts['use_user_thumb'] ??= '0';
- $posts['use_user_icon'] ??= '0';
- $this->configModel->save($posts, $attributes);
- $message = '기본 정보가 저장되었습니다.';
- return redirect()->route('admin.config.register.basic.index')->with('message', $message);
- }
- }
|