FormController.php 661 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. namespace App\Http\Controllers\QQMiniApp;
  3. use App\Models\QQ\FormIdModel;
  4. use Illuminate\Http\Request;
  5. use App\Http\Controllers\Controller;
  6. class FormController extends Controller
  7. {
  8. // 记录formId
  9. public function store(Request $request)
  10. {
  11. $this->validate($request, [
  12. 'appid' => 'required',
  13. 'openid' => 'required',
  14. 'form_id' => 'required',
  15. ]);
  16. if (!in_array($request->form_id, ['the formId is a mock one', ''])) {
  17. FormIdModel::create($request->all());
  18. }
  19. return response([
  20. 'code' => 200,
  21. 'message' => 'OK',
  22. ]);
  23. }
  24. }