PHP code example of themanwiththegoldenhand / lotr-php-sdk

1. Go to this page and download the library: Download themanwiththegoldenhand/lotr-php-sdk library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

themanwiththegoldenhand / lotr-php-sdk example snippets


use LOTR\LOTR;
TR(YOUR_APIKEY);

$response = $lotr->getMovies();

$response = $lotr->getMovies();

$response = $lotr->getMovie('5cd95395de30eff6ebccde56');

$response = $lotr->getMovieQuotes('5cd95395de30eff6ebccde5b');

$response = $lotr->getQuotes();

$response = $lotr->getQuote('5cd96e05de30eff6ebcce7e9');

$lotr->setLimit(2);
$response = $lotr->getMovies();

$lotr->setLimit(2);
$lotr->setPage(2);
$response = $lotr->getMovies();

$lotr->setOffset(1);
$lotr->setLimit(2);
$response = $lotr->getMovies();

$lotr->setSort('academyAwardWins', 'desc');
$response = $lotr->getMovies();

$lotr->setFilters([
            [
                'key' => 'race',
                'filter_type' => 'r',
                'filter_type' => 'not_match',
                'value' => 'Blonde'
            ],
            [
                'key' => 'name',
                'filter_type' => 'regex_match',
                'value' => 'king'
            ]
        ]);
$response = $lotr->getCharacters();

$lotr->setFilters([
            [
                'key' => 'boxOfficeRevenueInMillions',
                'filter_type' => '<',
                'value' => 1000
            ],
            [
                'key' => 'academyAwardWins',
                'filter_type' => '>=',
                'value' => 1
            ]
        ]);
$response = $lotr->getMovies();