Convert documents using unoconv inside a Laravel application.
angusm73/unoconv is a Laravel package for convert documents using unoconv inside a laravel application..
It currently has 0 GitHub stars and 20 downloads on Packagist (latest version v1.4).
Install it with composer require angusm73/unoconv.
Discover more Laravel packages by angusm73
or browse all Laravel packages to compare alternatives.
Last updated
A Laravel wrapper for unoconv.
Install this package through Composer.
Add this to your composer.json dependencies:
"require": {
"angusm73/unoconv": "dev-master"
}
Run composer install to download the required files.
Next you need to add the service provider to config/app.php
'providers' => [
...
Angusm73\Unoconv\UnoconvServiceProvider::class
]
Set up the facade. Add the reference in config/app.php to your aliases array.
'aliases' => [
...
'Unoconv' => Angusm73\Unoconv\Facades\Unoconv::class,
]
Publish the config
php artisan vendor:publish --provider="Angusm73\Unoconv\UnoconvServiceProvider" --tag="config"
# Convert the file to /file.pdf
Unoconv::file('/file.pptx')->to('pdf');
# Convert the file and save it in a different location /new/location/file.pdf
Unoconv::file('/file.pptx')->to('/new/location/file.pdf');
# Convert the file to /file.pdf and /file.jpg
Unoconv::file('/file.pptx')->to(['pdf', 'jpg]);
# Convert the file to /file.pdf and /preview/file.jpg
Unoconv::file('/file.pptx')->to(['pdf', '/preview/file.jpg]);
To use queues you will need have set-up the default laravel queue listener.
Unoconv::file('/file.pptx')->queue('pdf');
# You can also specify the queue.
Unoconv::file('/file.pptx')->onQueue('image-converter', 'pdf');
Unoconv::file('/file.pptx')->after((new AfterConversionJob()))->to('pdf');