Set up the Laravel Sample Application
mainThis sample application demonstrates how to integrate the Google Ads API into a Laravel environment. To run it, you must clone the repository, install dependencies via Composer within the specific sample directory, and configure your OAuth2 credentials.
Prerequisites
- A web server with a document root set to the application location (or Laravel Homestead).
- System requirements for the Google Ads API Client Library for PHP must be met.
- Valid OAuth2 credentials (follow the [Getting Started] guide in the main repository).
Installation Steps
- Clone the repository:
git clone https://github.com/googleads/google-ads-php.git - Navigate to the sample application directory:
cd google-ads-php/examples/LaravelSampleApp/ - Install dependencies:
Warning: Ensure you are inside thecomposer updateLaravelSampleAppdirectory before runningcomposer update, otherwise you will install dependencies for the library instead of the application. - Configure credentials:
- Copy your configured
google_ads_php.inifile into theexamples/LaravelSampleApp/directory.
- Copy your configured
- Start the application:
php artisan serve - Access the app via your browser (e.g.,
http://localhost:<PORT>).
git clone https://github.com/googleads/google-ads-php.git
cd google-ads-php/examples/LaravelSampleApp/
composer update
# Copy your google_ads_php.ini here
php artisan serve