| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- <?php
- namespace App\Http\Controllers\Admin\Config\Register;
- use Illuminate\Http\Request;
- use App\Http\Controllers\Controller;
- use App\Models\Config;
- class LoginController extends Controller
- {
- private Config $configModel;
- public function __construct(Config $config)
- {
- $this->configModel = $config;
- }
- /**
- * 로그인
- * @method GET
- * @see /admin/config/register/login
- */
- public function index()
- {
- return view('admin.config.register.login', []);
- }
- /**
- * 로그인 저장
- * @method POST
- * @see /admin/config/register/login
- */
- public function store(Request $request)
- {
- $rules = [
- 'change_password_day' => 'required|numeric|min:0|max:365',
- 'max_login_try_count' => 'required|numeric|min:0',
- 'max_login_try_limit_second' => 'required|numeric|min:0|max:86400',
- 'url_after_login' => 'string|nullable',
- 'url_after_logout' => 'string|nullable'
- ];
- $attributes = [
- 'change_password_day' => '비밀번호 갱신주기',
- 'max_login_try_count' => '로그인 시도 제한 횟수',
- 'max_login_try_limit_second' => '로그인 시도 제한시간',
- 'url_after_login' => '로그인 후 이동할 주소',
- 'url_after_logout' => '로그아웃 후 이동할 주소'
- ];
- $posts = $this->validate($request, $rules, [], $attributes);
- $this->configModel->save($posts, $attributes);
- $message = '정보 수정시 정보가 저장되었습니다.';
- return redirect()->route('admin.config.register.login.index')->with('message', $message);
- }
- }
|