omaromp2/laraprontoforms

用于在 Laravel 中使用 ProntoForms 的包

1.5 2022-06-13 17:55 UTC

This package is auto-updated.

Last update: 2024-09-13 22:48:45 UTC


README

banner

Laravel-ProntoForms

此包旨在以干净、简单的方式从 Laravel 项目直接向 ProntoForms 应用发送表单。

安装

  • 运行
 composer require omaromp2/laraprontoforms
  • 将以下行添加到您的 .env 文件中
 # ProntoForms Params
PRONTO_USER=<your_auth_prontoforms_user_name>
PRONTO_PASS=<your_auth_prontoforms_user_pass>
PRONTO_FORM_ID=<your_form_id>
PRONTO_USER_ID=<your_user_id>
  • 运行 php artisan vendor:publish 以发布包的配置文件。

使用(发送表单)

  • 将用例添加到您的控制器中
 use omaromp2\laraprontoforms\ProntoForms;
  • 准备一个数组,以您的表单标签作为键,答案作为值
$questions = [
    'Label1' => 'Answer1',
    'Label2' => 'Answer2',
]; 
  • 发送表单
ProntoForms::sendForm($questions);
  • 检查您的响应。

检索表单

$formId = '<your_form_submission_id>';
ProntoForms::fetchForm($form_id);

检索 PDF

$formId = '<your_form_submission_id>';
ProntoForms::fetchPDF($form_id);