PHP code example of amphibee / laravel-coconut

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

    

amphibee / laravel-coconut example snippets


// Create a coconut instance
$coconut = app('coconut');
$coconut->notification = [
    'type' => 'http',
    'url' =>  route('coconut.callback',$this->id),
    'metadata' => true
];

//Parameters
$jobParams = [
    'input' => ['url' => $this->rawUrl()],
    'outputs' => [
        'jpg:720x' => Storage::disk('gcs')->path($this->THUMBNAIL_DIRECTORY_PATH . $this->id . '.jpg') 
    ]
];

//Create the job
$job = $coconut->job->create($jobParams);