PHP code example of modalnetworks / digital-library

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

    

modalnetworks / digital-library example snippets


  
use Modalnetworks\DigitalLibrary\AuthenticatedBook;
use Modalnetworks\DigitalLibrary\DigitalSettings;
use Modalnetworks\DigitalLibrary\Digital;
use Modalnetworks\DigitalLibrary\Contracts\ResponseDigitalContract;

$data = [
    'FirstName' => 'Joe',
    'LastName' => 'Legal',
    'Email'    => '[email protected]',
    'Isbn'     => '9788502628489'
    ];
//start item with data
$book = new AuthenticatedBook($data);
//add your token
$token = 'your_token';

/**
* configure with your token
* opitional param for add name application
*/
$settings = new DigitalSettings($token);

//add settings in digital library for get url authenticated for read ebook
$digital = new Digital($settings);

//run for get link 
$digital->run($book, function(ResponseDigitalContract $digital){
    dump($digital);
});
 
 
 php
  composer