Package Data | |
---|---|
Maintainer Username: | akaramires |
Maintainer Contact: | e.abdurayimov@gmail.com (Elmar Abdurayimov) |
Package Create Date: | 2016-05-16 |
Package Last Update: | 2021-01-18 |
Home Page: | |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-12-26 15:24:43 |
Package Statistics | |
---|---|
Total Downloads: | 54 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 12 |
Total Watchers: | 2 |
Total Forks: | 11 |
Total Open Issues: | 2 |
Installation using composer:
composer require akaramires/laravel-googleforms
And add the service provider in config/app.php:
Akaramires\GoogleForms\GoogleFormsServiceProvider::class,
Laravel 5 Google Forms requires configuration.
To get started, first publish the package config file:
php artisan vendor:publish --provider="Akaramires\GoogleForms\GoogleFormsServiceProvider"
You need also get access token
php artisan google-forms:token
vendor/akaramires/laravel-googleforms/scripts
directory)config/googleforms.php
$form = App::make('GoogleForm');
$params = [
'file_name' => sha1(microtime(true)),
'file_description' => 'File was created by ' . get_current_user() . ' (' . app()->environment() . ')',
'title' => 'Super title',
'description' => 'Super description',
'confirmation_message' => 'Your response has been recorded.',
'show_progress' => false,
'limit_one_response_per_user' => false,
'shuffle_questions' => false,
'show_link_to_respond_again' => false,
'publish_and_show' => false,
'allow_response_edits' => false,
'accepting_responses' => true,
];
$form->createForm($params);
$fields = [];
$textItem = new TextItem();
// $textItem->setId($field->google_id); # if you have saved field id
$textItem->setTitle('Field title');
$textItem->setHelpText('Field help text');
$textItem->setRequired(true);
$textItem->setIndex(0);
$fields[] = $form->createOrUpdateElement($textItem, true);
$queries = [
'form' => $form->createForm($params, true),
'fields' => $fields,
];
$request = $this->form->batchRequest($queries);;
print_r($request);