<?php

namespace App\Http\Controllers\QQMiniApp;

use App\Models\QQ\FormIdModel;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;

class FormController extends Controller
{


    // 记录formId
    public function store(Request $request)
    {
        $this->validate($request, [
            'appid' => 'required',
            'openid' => 'required',
            'form_id' => 'required',
        ]);

        if (!in_array($request->form_id, ['the formId is a mock one', ''])) {
            FormIdModel::create($request->all());
        }
        return response([
            'code' => 200,
            'message' => 'OK',
        ]);
    }
}
