PHPackages                             jorisvanw/cloudconvert-laravel - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. jorisvanw/cloudconvert-laravel

ActiveLibrary[API Development](/categories/api)

jorisvanw/cloudconvert-laravel
==============================

A Laravel wrapper for the CloudConvert API

v2.1.7(10y ago)224MITPHPPHP &gt;=5.4.0

Since Nov 21Pushed 10y ago1 watchersCompare

[ Source](https://github.com/jorisvanw/cloudconvert-laravel)[ Packagist](https://packagist.org/packages/jorisvanw/cloudconvert-laravel)[ RSS](/packages/jorisvanw-cloudconvert-laravel/feed)WikiDiscussions 2.x Synced 2mo ago

READMEChangelogDependencies (6)Versions (23)Used By (0)

CloudConvert Laravel API
========================

[](#cloudconvert-laravel-api)

A Laravel wrapper for the CloudConvert API. See  for more details.

[![Build Status](https://camo.githubusercontent.com/5f594ab18dbb20e99031c6036d8a13ee1e99116f679fa557855c40fc63695d6b/68747470733a2f2f7472617669732d63692e6f72672f726f626269657061756c2f636c6f7564636f6e766572742d6c61726176656c2e7376673f6272616e63683d76302e31)](https://travis-ci.org/robbiepaul/cloudconvert-laravel)

Installation
------------

[](#installation)

Install this package through [Composer](https://getcomposer.org/).

Add this to your `composer.json` dependencies:

### Using Laravel 5.0+

[](#using-laravel-50)

```
"require": {
   "robbiep/cloudconvert-laravel": "2.*"
}
```

### Using Laravel ~4.2

[](#using-laravel-42)

```
"require": {
   "robbiep/cloudconvert-laravel": "1.*@dev"
}
```

Run `composer install` to download the required files.

Next you need to add the service provider to `config/app.php`

```
'providers' => array(
    ...
    RobbieP\CloudConvertLaravel\CloudConvertLaravelServiceProvider::class
)
```

One more step.

You need to publish the config `php artisan vendor:publish`

> Laravel 4 requires slightly different syntax for publishing configs, use `php artisan config:publish robbiep/cloudconvert-laravel`

Just enter your API key in `config/cloudconvert.php`

> You can get your free API key by registering at

Now you can use CloudConvert in your application!

Usage
-----

[](#usage)

There's many ways to use CloudConvert. I'll cover a few of them here, for all the converter options I suggest checking out the API docs.

### File conversion

[](#file-conversion)

```
# Convert the file to /a/path/to/file.mp4

CloudConvert::file('/a/path/to/file.mov')->to('mp4');
```

```
# Convert the file and save it in a different location /a/new/path/to/new.mp4

CloudConvert::file('/a/path/to/biggles.webm')->to('/a/new/path/to/new.mp4');
```

```
# It also works with Laravel's file upload

if (Input::hasFile('photo'))
{
    CloudConvert::file( Input::file('photo') )->to('/a/local/path/profile_image.jpg');
}
```

```
# Convert the image to kitty.jpg with quality of 70%

CloudConvert::file('kitty.png')->quality(70)->to('jpg');
```

```
# Convert a PowerPoint presentation to a set of images, let's say you only want slides 2 to 4
# This will save presentation-2.jpg, presentation-3.jpg and presentation-4.jpg

CloudConvert::file('presentation.ppt')->pageRange(2, 4)->to('jpg');
```

#### Dynamic file conversion

[](#dynamic-file-conversion)

```
# Dynamic PDF creation using DOCX/PPTX templates
# See this blog post for more details: https://cloudconvert.com/blog/dynamic-pdf-creation-using-docx-templates/

$variables = ['name' => 'John Doe', 'address' => 'Wall Street'];
CloudConvert::file('invoice_template.docx')->templating($variables)->to('invoice.pdf');
```

#### Converter options

[](#converter-options)

There are many more conversion options. I've put shortcuts like the ones above for the most common. However you can pass through any options you like using the `withOptions` method, such as:

```
# Convert the meow.wav to meow.mp3 with a frequecy of 44100 Hz and normalize the audio to +20dB

CloudConvert::file('meow.wav')->withOptions([
    'audio_frequency' => '44100',
    'audio_normalize' => '+20dB'
])->to('mp3');

# Convert the fido_falls_over.mp4 to fido.gif but you only want 10 seconds of it, starting at 1:02

CloudConvert::file('fido_falls_over.mp4')->withOptions([
    'trim_from' => '62',
    'trim_to' => '72'
])->to('fido.gif');

# Or the same with using the shortcuts:
CloudConvert::file('fido_falls_over.mp4')->trimFrom(62)->trimTo(72)->to('fido.gif');
```

#### Chaining multiple conversions

[](#chaining-multiple-conversions)

You can also chain multiple conversions on one process, like this:

```
# Convert a TrueType font in to all the fonts you need for a cross browser web font pack

CloudConvert::file('claw.ttf')->to('eot', true)->to('otf', true)->to('woff', true)->to('svg');

# Or the same thing with an array
CloudConvert::file('claw.ttf')->to(['eot', 'otf', 'woff', 'svg']);
```

#### Remote files

[](#remote-files)

It will also work with converting remote files (just make sure you provide a path to save it to)

```
# Convert Google's SVG logo hosted on Wikipedia to a png on your server

CloudConvert::file('http://upload.wikimedia.org/wikipedia/commons/a/aa/Logo_Google_2013_Official.svg')
            ->to('images/google.png');
```

### Website screenshot

[](#website-screenshot)

CloudConvert will also take a screenshot of a website and convert it to an image or pdf for you:

```
# Take a screenshot with the default options: 1024px with with full height of webpage

CloudConvert::website('www.nyan.cat')->to('screenshots/nyan.jpg');
```

```
# You can also specify the width and the height as converter options

CloudConvert::website('www.nyan.cat')
            ->withOptions([
                 'screen_width' => 1024,
                 'screen_height' => 700
            ])->to('screenshots/nyan.png');
```

### Converting to and from external storage options

[](#converting-to-and-from-external-storage-options)

At the moment CloudConvert let you use *FTP* or *Amazon S3* as storage options. However it looks like in the future they will add *Google Drive* and *Dropbox* to the API

> \*\*Please note: \*\* To use these storage options you will need to provide the configuration in the `config/packages/robbiep/cloudconvert-laravel/config.php`

```
# Lets say you have a PDF and you want to convert it to an ePub file and
# store it on your Amazon S3 bucket (defined in your config). It's this simple:

CloudConvert::file('/a/local/path/garfield.pdf')->to(CloudConvert::S3('Garfield_converted.epub'));
```

```
# You can also override the default options by providing them as an array as the second argument

CloudConvert::file('/a/local/path/garfield.pdf')
            ->to(CloudConvert::S3('Garfield_converted.epub', [
                'bucket'  => 'a-different-bucket',
                'acl'     => 'public-read',
                'region'  => 'us-east-1'
            ]));
```

```
# Now you want to convert the file on your S3 to a txt file and store it on a server via FTP

CloudConvert::file(CloudConvert::S3('Garfield_converted.epub'))
            ->to(CloudConvert::FTP('path/to/garfield.txt'));
```

It's that simple. The storage options `CloudConvert::S3($path)` and `CloudConvert::FTP($path)` can be used for both input files and output files.

### Non-blocking conversion using a callback URL

[](#non-blocking-conversion-using-a-callback-url)

When the conversion might take a long time you could use:

```
# Script: send_conversion.php
CloudConvert::file('/a/path/to/file.mov')
            ->callback('http://myserver.com/save_file.php')
            ->convert('mp4');

# Script save_file.php
CloudConvert::useProcess($_REQUEST['url'])
            ->save('/path/converted.mp4');
```

### Non-blocking conversion using a queue

[](#non-blocking-conversion-using-a-queue)

To use queues you will need have set-up either beanstalk or iron in your `config/queue.php`

```
# The queue will check every second if the conversion has finished.
# It times out after 120 seconds (configurable).

CloudConvert::file('/a/path/to/file.mov')->queue('to', '/a/path/to/file.mp4')
```

### Conversion types

[](#conversion-types)

You can view the conversion types using the `conversionTypes()` method. It always returns `Illuminate\Support\Collection`.

```
# To get all possible types

$types = CloudConvert::conversionTypes();
```

```
# To get all possible types in a specific group

$types = CloudConvert::conversionTypes('video');
```

```
# To get all possible output formats if you know the input format

$types = CloudConvert::input('pdf')->conversionTypes();
```

```
# Same if you know the output format and want to see what can be inputted

$types = CloudConvert::output('jpg')->conversionTypes();
```

### Processes status

[](#processes-status)

You may want to list all your processes, running, finished and failed. It always returns a `Illuminate\Support\Collection`.

```
# To get all possible types
$processes = CloudConvert::processes();

# To delete a process by ID
CloudConvert::deleteProcess($process_id);
```

Artisan commands
----------------

[](#artisan-commands)

If you want to do quick conversions or calls to the API from your console, you can use the following commands:

#### Convert a file

[](#convert-a-file)

```
# Options: --opions, --background, --storage, --path
php artisan cloudconvert:convert video.mov mp4
php artisan cloudconvert:convert /path/to/video.mov converted.mp4 --storage='s3'
```

#### Website screenshot

[](#website-screenshot-1)

```
# Options: --opions, --storage, --path
php artisan cloudconvert:website www.laravel.com jpg
```

#### Processes list

[](#processes-list)

```
# Options: --delete (used with process_id)
# Argument: process_id (optional) - will show the status of that process
php artisan cloudconvert:processes
```

#### Conversion types

[](#conversion-types-1)

```
# Options: --input, --output
# (both optional - however if you included both you will see all the
# possible converter options for those types, not just the default ones)
php artisan cloudconvert:types
php artisan cloudconvert:types --input='nice.pdf'
php artisan cloudconvert:types --input='doc' --output='jpg'
```

Using this package without Laravel
----------------------------------

[](#using-this-package-without-laravel)

You still need to use composer. Type `composer require robbiep/cloudconvert-laravel` to download the files, then you can use the package like this:

```
require_once('vendor/autoload.php');

$cloudConvert = new RobbieP\CloudConvertLaravel\CloudConvert(['api_key' => 'API_KEY_HERE']);

$cloudConvert->file('randomuser.jpg')->to('png');
```

Todo
----

[](#todo)

- Release
- Write some more tests
- Enable merging of multiple files
- Enable multiple conversions using one process
- Refactor the commands

Contributing
------------

[](#contributing)

1. Fork it
2. Create your feature branch: `git checkout -b my-new-feature`
3. Commit your changes: `git commit -am 'Add some feature'`
4. Push to the branch: `git push origin my-new-feature`
5. Submit a pull request

Credits
-------

[](#credits)

Thanks to [Lunaweb Ltd.](http://www.lunaweb.de/) for their API. Go [check it out](https://cloudconvert.org/page/api).

Resources
---------

[](#resources)

- [API Documentation](https://cloudconvert.org/page/api)
- [Conversion Types](https://cloudconvert.org/formats)
- [CloudConvert Blog](https://cloudconvert.org/blog)

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 93.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~20 days

Recently: every ~1 days

Total

22

Last Release

3770d ago

Major Versions

0.1 → v1.0.12014-11-21

v1.0.3 → v2.0.0-beta2014-11-23

v1.0.4 → v2.0.1-beta2014-11-23

1.x-dev → v2.12015-04-20

### Community

Maintainers

![](https://www.gravatar.com/avatar/61791473a04a2f1535d7cb64d69b6d7f1d715535e64da8a62ec70b6370cdedbb?d=identicon)[JorisvanW](/maintainers/JorisvanW)

---

Top Contributors

[![robbiepaul](https://avatars.githubusercontent.com/u/2804149?v=4)](https://github.com/robbiepaul "robbiepaul (55 commits)")[![JorisvanW](https://avatars.githubusercontent.com/u/11089853?v=4)](https://github.com/JorisvanW "JorisvanW (2 commits)")[![scrutinizer-auto-fixer](https://avatars.githubusercontent.com/u/6253494?v=4)](https://github.com/scrutinizer-auto-fixer "scrutinizer-auto-fixer (1 commits)")[![vinicius73](https://avatars.githubusercontent.com/u/1561347?v=4)](https://github.com/vinicius73 "vinicius73 (1 commits)")

---

Tags

laravelconversionofficescreenshotlaravel4documentscloudconvert

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/jorisvanw-cloudconvert-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/jorisvanw-cloudconvert-laravel/health.svg)](https://phpackages.com/packages/jorisvanw-cloudconvert-laravel)
```

###  Alternatives

[irazasyed/telegram-bot-sdk

The Unofficial Telegram Bot API PHP SDK

3.3k4.5M84](/packages/irazasyed-telegram-bot-sdk)[dcblogdev/laravel-microsoft-graph

A Laravel Microsoft Graph API (Office365) package

168285.5k1](/packages/dcblogdev-laravel-microsoft-graph)[vluzrmos/slack-api

Wrapper for Slack.com WEB API.

102589.1k3](/packages/vluzrmos-slack-api)[dcblogdev/laravel-xero

A Laravel Xero package

53129.1k1](/packages/dcblogdev-laravel-xero)[ardakilic/mutlucell

Mutlucell SMS API wrapper for sending sms text messages for Laravel

457.3k](/packages/ardakilic-mutlucell)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
