PHP code example of sevenspan / bunny
1. Go to this page and download the library: Download sevenspan/bunny 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/ */
sevenspan / bunny example snippets
composer
php artisan vendor:publish --tag=config
return [
/*
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
| API KEY.
|
*/
'api_key' => env('BUNNY_API_KEY', ''),
/*
|--------------------------------------------------------------------------
|SIGNED URL
|--------------------------------------------------------------------------
|
| SIGNED URL.
|
*/
'signed_url' => env('BUNNY_SIGNED_URL', ''),
/*
|--------------------------------------------------------------------------
| EXPIRATION TIME
|--------------------------------------------------------------------------
|
| EXPIRATION TIME
|
*/
'expiration_time' => env('BUNNY_EXPIRATION_TIME', '360'),
];
use Sevenspan\Bunny\Bunny;
getImageUrl($path)
$path = "capital_test.PNG";
$url = Bunny::getImageUrl($path);