omaromp2/laraprontoforms

Package for using ProntoForms in Laravel

1.5 2022-06-13 17:55 UTC

This package is auto-updated.

Last update: 2024-11-13 23:08:53 UTC


README

banner

Laravel-ProntoForms

Package intended for sending forms to the ProntoForms app directly from a Laravel project in a clean and simple way.

Installation

  • Run
 composer require omaromp2/laraprontoforms
  • Add the following line to your .env file:
 # 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>
  • Run php artisan vendor:publish to publish the package's config file.

Usage (Send Form)

  • Add the use case to your controller:
 use omaromp2\laraprontoforms\ProntoForms;
  • Prepare an array with your form label as the key and the answer as the value:
$questions = [
    'Label1' => 'Answer1',
    'Label2' => 'Answer2',
]; 
  • Send the form:
ProntoForms::sendForm($questions);
  • Check your response.

Retrieve Form

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

Retrieve PDF

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