sunlight-php
![Software License][ico-license]
![Coverage Status][ico-scrutinizer]
![Total Downloads][ico-downloads], (*1)
A limited PHP wrapper for the Sunlight Foundation APIs designed for use on contactmyreps.org, (*2)
Install
Via Composer, (*3)
``` bash
$ composer require contactmyreps/sunlight-php, (*4)
## Usage
``` php
$sunlight = new Sunlight($apikey);
$openStates = $sunlight->openStates();
$congress = $sunlight->congress();
//get all Alabama's state legislators
$states->legislators(
[
'state' => 'AL'
],
);
//get all State reps serving a gps coordinate
$states->geoLookup($lat, $lng);
//get all Congressional representatives serving an area
$congress->locateByZip(11111);
$congress->locateByGeo($lat, $lng);
$request methods can be passed an optional extra array argument of display fields to return (last_name, first_name, etc.)
Change log
Please see CHANGELOG for more information what has changed recently., (*5)
Testing
bash
$ composer test
, (*6)
Contributing
Please see CONTRIBUTING and CONDUCT for details., (*7)
Security
If you discover any security related issues, please email edfialk@gmail.com instead of using the issue tracker., (*8)
Credits
License
The MIT License (MIT). Please see License File for more information., (*9)