PHP code example of kirschbaum-development / bee-plugin-php-client

1. Go to this page and download the library: Download kirschbaum-development/bee-plugin-php-client 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/ */

    

kirschbaum-development / bee-plugin-php-client example snippets


$beeEditorData = []; // this will be the JSON generated using the editor
$html = $bee->html($beeEditorData);

$pdf = $bee->pdf([
    'html' => $html, // HTML generated using the HTML API (pe', // (optional)
]);

// then, you can call these methods:
$pdf->getUrl();
$pdf->getFilename();
$pdf->getPageSize();
$pdf->getPageOrientation();
$pdf->getContentType();

$image = $bee->image([
    'html' => $html, // HTML generated using the HTML API (pe' => 'jpg',
]);

// then, you can save the image content somewhere, some examples on how you may do this:
file_put_contents('/path/to/storage/image.jpg', $image);

// on Laravel with Storage object:
Storage::put('/path/to/storage/image.jpg', $image);

use KirschbaumDevelopment\Bee\BeeAuth;

$beeAuth = new BeeAuth(new \GuzzleHttp\Client);
$beeAuth->setClientId('your-client-id-here');
$beeAuth->setClientSecret('your-client-secret-here');
$token = $beeAuth->generateToken();

// then you can use the following methods:
$token->getAccessToken();
$token->getRefreshToken();
$token->getExpires();

$beeAuth->setCache($cacheImplementation);

'providers' => [
    // ...
    KirschbaumDevelopment\Bee\Laravel\BeePluginServiceProvider::class,
],

use KirschbaumDevelopment\Bee\Laravel\BeeAuthMock;

BeeAuthMock::init();
 php
use KirschbaumDevelopment\Bee\Bee;

$bee = new Bee(new \GuzzleHttp\Client);
$bee->setApiToken('your-api-token-here');