| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- <?php
- namespace App\Http\Controllers\Admin\Config\Setting;
- use Illuminate\Http\Request;
- use App\Http\Controllers\Controller;
- use App\Models\Config;
- class ExpController extends Controller
- {
- private Config $configModel;
- public function __construct(Config $config)
- {
- $this->configModel = $config;
- }
- /**
- * 경험치
- * @method GET
- * @see /admin/config/setting/exp
- */
- public function index()
- {
- return view('admin.config.setting.exp', []);
- }
- /**
- * 경험치 저장
- * @method POST
- * @see /admin/config/setting/exp
- */
- public function store(Request $request)
- {
- $rules = [
- 'use_exp' => 'numeric|nullable',
- 'exp_register' => 'numeric|nullable',
- 'exp_login' => 'numeric|nullable',
- 'exp_recommended' => 'numeric|nullable',
- 'exp_recommender' => 'numeric|nullable',
- 'exp_attendance' => 'numeric|nullable',
- 'exp_poll' => 'numeric|nullable'
- ];
- $attributes = [
- 'use_exp' => '경험치 기능',
- 'exp_register' => '회원가입 시 경험치',
- 'exp_login' => '로그인 시 경험치',
- 'exp_recommended' => '회원가입 시 추천인에게 경험치',
- 'exp_recommender' => '추천인 존재 시 가입자에게 경험치',
- 'exp_attendance' => '출석 시 경험치',
- 'exp_poll' => '설문조사 시 경험치'
- ];
- $posts = $this->validate($request, $rules, [], $attributes);
- $this->configModel->save($posts, $attributes);
- $message = '경험치 정보가 저장되었습니다.';
- return redirect()->route('admin.config.setting.exp.index')->with('message', $message);
- }
- }
|