| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- <?php
- namespace App\Http\Controllers\Admin\Config\Form;
- use Illuminate\Http\Request;
- use App\Http\Controllers\Controller;
- use App\Models\Config;
- class TelegramController extends Controller
- {
- private Config $configModel;
- public function __construct(Config $config)
- {
- $this->configModel = $config;
- }
- /**
- * 텔레그램 양식
- * @method GET
- * @see /admin/config/form/telegram
- */
- public function index()
- {
- return view('admin.config.form.telegram', []);
- }
- /**
- * 텔레그램 양식 저장
- * @method POST
- * @see /admin/config/form/telegram
- */
- public function store(Request $request)
- {
- $rules = [
- 'send_telegram_crawling_form_content' => 'string|nullable', // 영화 정보 수집 시
- 'send_telegram_daliy_visits_form_content' => 'string|nullable' // 일 방문 통계(24시간)
- ];
- $attributes = [
- 'send_telegram_crawling_form_content' => '영화 정보 수집 시',
- 'send_telegram_daliy_visits_form_content' => '일 방문 통계(24시간)'
- ];
- $posts = $this->validate($request, $rules, [], $attributes);
- $this->configModel->save($posts);
- $message = '텔레그램 양식 정보가 저장되었습니다.';
- return redirect()->route('admin.config.form.telegram.index')->with('message', $message);
- }
- }
|