Package Data | |
---|---|
Maintainer Username: | joe_archer |
Maintainer Contact: | joe.archer@gmail.com (Joe Archer) |
Package Create Date: | 2015-02-28 |
Package Last Update: | 2016-09-20 |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-11-07 03:11:54 |
Package Statistics | |
---|---|
Total Downloads: | 6 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 2 |
Total Watchers: | 2 |
Total Forks: | 1 |
Total Open Issues: | 0 |
Simple Rotten Tomatoes API wrapper for Laravel 5
Require this package in composer.json and run composer update
"joearcher/tomatoes": "dev-master"
After updating add the ServiceProvider the the providers array in app/config/app.php
'Joearcher\Tomatoes\TomatoesServiceProvider',
And then you can add the facade to the Facades array
'Tomatoes' => 'Joearcher\Tomatoes\Facades\Tomatoes',
Publish the config
artisan vendor:publish
This creates a tomatoes.php
file in app/config
Add your api key to tomatoes.php
'apikey' => '<Your API key here>'
Available endpoints:
All requests return an array()
.
Search queries can be returned as pages of results, pagination can be performed with the 2nd and 3rd parameters, though they are optional.
Performing a basic search:
Tomatoes::search("Terminator");
Will return all results for the given search term.
To search for the term "war" limiting to 10 results per page and viewing page 2 of the results:
Tomatoes::search("war",10,2);
Results are ordered by most recent release date first, this is set by the API and cannot be changed.
Further information on a specific movie by it's ID:
Tomatoes::movie(771245718);
Will return the detailed information for 'Django Unchained'
The remaining endpoints take the same format:
Tomatoes::cast(771245718);
Tomatoes::reviews(771245718);
Tomatoes::similar(771245718);
Made possible by the awesome Guzzle Http client