PHP code example of nidhalkratos / laravel-coconut-v2

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

    

nidhalkratos / laravel-coconut-v2 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);