PHP code example of cbzink / launchlibrary

1. Go to this page and download the library: Download cbzink/launchlibrary 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/ */

    

cbzink / launchlibrary example snippets


use cbzink\LaunchLibrary\LL2;

$client = new LL2($apiToken, $apiEndpoint);

$client->setPaginationLimit(30);

$client->getPaginationLimit() // (int) 30

$results = $client->agencies()->search([
    'country_code' => 'US',
]);

$agencies = $client->agencies()->search();

// Array of Agency resources.
$resources = $agencies->results;

// Fetch the next page of results
$agencies = $agencies->next();

$results = $client->agencies()->fetch(123);

// Previous
$results = $client->events()->previous()->search();

// Upcoming
$results = $client->launches()->upcoming()->search();

$results = $client->spacecraft()->flights()->search();