Laravel Sample Application

This is a sample application demonstrating how to use Google Ads API in a Laravel application.

Preparations

We recommend using Laravel Homestead to satisfy all Laravel usage requirements. See this page for installation instructions. If you're not using Homestead, make sure your web server has a document root set to the location of this sample application.

Please make sure that your system fulfils all the requirements of the Google Ads API Client Library for PHP.

Instructions

  1. Run composer install or composer update at the command prompt. This will install all dependencies needed for running this application. WARNING: Make sure you are in the directory of this sample application. If you run those commands from the root directory of this library, it will install dependencies for the library instead.
  2. Follow the Set up your OAuth2 credentials instructions from the Getting Started documentation if you haven't set up the credentials yet.
  3. Copy your configured google_ads_php.ini to the same location as this README.md file.
  4. Run php artisan serve. Your sample app will be ready.
  5. You can now test the sample app by using the web browser at the URL you've set in your virtual machine or web server, e.g., http://localhost:<PORT>.

Note

  1. Don't forget to follow instructions for directory configuration, or you'll face file permission errors when running this sample application.
  2. In case you turn on logging and specify the log file paths in google_ads_php.ini, make sure that your web server has permission to write to those files too.

License

  • The Laravel framework is open-sourced software licensed under the MIT license.
  • The Google Ads API PHP client library is open-sourced under the Apache License 2.0.