Download the PHP package smadeira/planning-center-api without Composer
On this page you can find all versions of the php package smadeira/planning-center-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download smadeira/planning-center-api
More information about smadeira/planning-center-api
Files in smadeira/planning-center-api
Package planning-center-api
Short Description PHP API wrapper for the Planning Center JSON API
License MIT
Informations about the package planning-center-api
Planning Center API Wrapper
A PHP wrapper to access Planning Center data.
Installation
Include the Package
This package is installed via Composer and the following assumes you have installed and initialized Composer for the project. Please refer to the Composer web site for help on getting composer installed and your initial composer.json created.
To add the Ministry Platform API to your project, simply require this package:
Or, you can edit your composer.json file directly to add the Ministry Platform API:
Update the package
After including the API Wrapper with composer, do a composer update to download the dependencies required for the API wrapper to function.
The update command will download all the dependencies (including the API wrapper code) to the vendor diretory. Once this is done, you are ready to start development.
Mote: It's a good idea to run "composer update" every so often to download the latest version of the API wrapper and all of its dependencies. That's the beauty of Composer. It manages all of that for you so you don't have to.
Configuration
There are a few things that need to be done to configure the API wrapper to function in your environment.
Connection Parameters
This package makes use of vlucas/phpdotenv to manage configuration variables. In the root of your project, create a .env file with the following contents. Ensure you are using the correct URIs, client ID and secret for your installation.
Loading the API Wrapper
At the top of your code you will need to do a couple things to get access to the API Wrapper. You need to include autoload capabilities and load the config settings from the .env file
This is an example of what the top of a script might look like.
Usage
Usage is straight forward. Construct and execute your request.
Execute select query
The API Wrapper uses the same syntax and format as the online Planning Center API page. To execute a simple query you define the various components and execute. This sample will get all of the People in the People module (currently supports People and Services) with a last name of Smith and includes references to their addresses, emails and phone numbers. It is sorted in descending order of last name (Z - A)
The whole script
Here is the whole script...