PHP code example of codingmonkeys / laravel-fileflux

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

    

codingmonkeys / laravel-fileflux example snippets


$response = (new FileFlux)
    ->project('{project-id}')
    ->webhook('https://{yourdomain.com}/file-flux/webhooks')
    ->workflow('ConvertAudioWorkflow')
    ->source('source/89-test copy.wav')
    ->target([
        'extension' => 'mp3',
        'filename' => 'target/converted2222.mp3',
        'channels' => 2,
        'bitrate' => 128,
    ])
    ->convert();

// Example with preset.
$response = (new FileFlux)
    ->source('source/large.wav')
    ->preset('my-preset')
    ->target('target/large.mp3')
    ->convert();

$response = (new FileFlux)
    ->project('{project-id}')
    ->webhook('https://{yourdomain.com}/file-flux/webhooks')
    ->workflow('ConvertAudioWorkflow')
    ->source('source/89-test copy.wav')
    ->target([
        'format' => 'webp',
        'quality' => 100,
        'folder' => 'target/folder',
        'pages' => 'all',
        'resolution' => 150,
    ])
    ->convert();

// Example with preset.
$response = (new FileFlux)
    ->source('source/my-pdf-file.pdf')
    ->preset('pdf-to-image')
    ->target('target/folder')
    ->convert();