Isset / alfredo-laravel by IssetBV

Laravel wrapper for Alfredo
0
1
6
Package Data
Maintainer Username: IssetBV
Maintainer Contact: hey@mitchellvanwijngaarden.nl (Mitchell van Wijngaarden)
Package Create Date: 2013-10-23
Package Last Update: 2013-10-25
Language: PHP
License: Unknown
Last Refreshed: 2024-03-27 03:18:43
Package Statistics
Total Downloads: 0
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 1
Total Watchers: 6
Total Forks: 0
Total Open Issues: 0

Alfredo for Laravel

This package is merely an Alfredo wrapper written for Laravel. It will ease a lot of the tasks provided from the Alfredo client.

Table of Contents

Documentation

Installation

Usage

License

```json
"issetbv/alfredo-laravel": "dev-master"
```
  1. Update dependencies

    composer update
    
  2. Publish configuration file

    php artisan config:publish issetbv/alfredo-laravel
    
  3. Add Service Provider to the providers array in app/config/app.php

    'IssetBv\AlfredoLaravel\AlfredoServiceProvider',
    
  4. Add Facade to the facades array in app/config/app.php

    'Alfredo' => 'IssetBv\AlfredoLaravel\Facade',
    
  5. Add API keys to the configuration file in app/config/packages/issetbv/alfredo-laravel/config.php

Available: addHtml, addPdf, addUrl

$payload = Alfredo::makePayload();
$payload->addUrl('http://isset.nl');

Available: html, pdf, url

$payload = Alfredo::makePayloadWithSources(array(
    array('url', 'http://isset.nl'),
    array('html', '<html><thead></thead><tbody>Create payload with sources!</tbody></html>')
));

Stream a payload:

$payload = Alfredo::makePayload();
$payload->addHtml('<html><thead></thead><tbody>Streaming a payload!</tbody></html>');
$response = Alfredo::stream($payload); // returns a Response object

Stream a converted payload:

$payload = Alfredo::makePayload();
$payload->addHtml('<html><thead></thead><tbody>Streaming a converted payload!</tbody></html>');
$pdf = Alfredo::convert($payload);
$response = Alfredo::stream($pdf); // returns a Response object

When using the queue, its necessary to set the callback url.

$payload = Alfredo::makePayloadWithCallback('http://example.com/callback_url');
$payload->addHtml('<html><thead></thead><tbody>Queueing a payload!</tbody></html>');
$response = Alfredo::queue($payload); // returns a JSON response
{
    "response":"Queued",
    "identifier":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}

License

MIT