Skip to content

Send data from a Google Form to PHP or Laravel through Google App Script

Notifications You must be signed in to change notification settings

hacker-prime/google-form-to-php-or-laravel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Google Form to PHP or Laravel

The purpose of this repository is to show how data can be sent from a Google Form to either PHP or Laravel. The data will not be stored to a database but a txt file as it is quicker to test.I am doing this to help solidfy my experience with this, particularly the Laravel aspect since I am new to it and to help others especially the less experienced. There will be two folders, pure php and laravel respectively.

Research

These are some of the links I consulted to help understand all of this

Ngrok

Google App Script can only work with a public url that can be accessed via the internet and I was doing development on the localhost/development environment so I used ngrokto bypass this issue. When you move from development to production you'd just use the registered domain in question for example shaynhacker.com in the url section of Google App Script.

Laravel

When testing via Laravel, you need two two terminal windows.

  • The first terminal window should utilize php artisan serve so we have a server that's running
  • The second terminal window should have ngrok running.
  • NOTE - The first terminal window will have the server running on the following url/port - http://127.0.0.1:8000/ and the second terminal window should have ngrok running on the same port. The ngrok command for that would be as follows: './ngrok http 8000'. Also, the ngrok file should be placed at the root level of the laravel folder so that when it runs the folder it is in will be used for the public url that will be accessible over the internet.
  • During my testing/experimenting I was using web.php but it turns out that you should api.php instead. The web.php is used for serving webpages while the api.php is for receiving or sending out data.
  • The file in the php folder labeled googleappscript.js can also be used if we send the data to a laravel backend/application. However, the url to be used in Google App Script would have to be something like the following:

YouTube Demonstration

About

Send data from a Google Form to PHP or Laravel through Google App Script

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published