A composer package for the Kraken PHP API which supports the Laravel 5 framework. Original package by https://github.com/danvuquoc/laravel-kraken, but wasn't updated in months for Laravel 5.4 and 5.5. Credits go completely to him!, (*1)
laravel-kraken
A composer package for the Kraken PHP API which supports the Laravel 5
framework., (*2)
Composer Installation
The best way to install laravel-kraken is with Composer., (*3)
To install the most recent version, run the following command., (*4)
$ php composer.phar require acrossoffwest/laravel-kraken
, (*5)
Alternatively, you may edit your composer.son directly by adding the following
to the require section., (*6)
"require": {
"acrossoffwest/laravel-kraken": "1.*",
}
Integration in Laravel
Providers
Register the service provider in config/app.php
by inserting it into the
providers array:, (*7)
'providers' => [
...
Danvuquoc\Kraken\KrakenServiceProvider::class,
...
]
Publish Configuration File
Running the following command will publish config/kraken.php
to your config
folder. In this file you will need to insert your api key and api secret., (*8)
$ php artisan vendor:publish
—provider="Danvuquoc\Kraken\KrakenServiceProvider"
, (*9)
Facade
Register the facade in config/app.php
by inserting it into the aliases array:, (*10)
'aliases' => [
...
'KrakenIO' => Danvuquoc\Kraken\KrakenFacade::class,
...
]
Usage
Be sure to use KrakenIO;
in your code, (*11)
Then you can simply:, (*12)
$response = KrakenIO::url([
'url' => 'http://url-to-image.com/file.jpg',
'wait' => true,
]);
Full documentation on the Kraken PHP Api is available on their Kraken PHP API
Github Repo., (*13)