justbetter / laravel-akeneo-images
Upload images automatically to Akeneo
Installs: 48
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 0
Open Issues: 0
Type:package
Requires
- php: ^8.1
- justbetter/laravel-akeneo-client: ^1.4
- laravel/framework: ^10.0|^11.0
Requires (Dev)
- larastan/larastan: ^2.9
- laravel/pint: ^1.10
- orchestra/testbench: ^8.0|^9.0
- phpstan/phpstan-mockery: ^1.1
- phpunit/phpunit: ^10.2
README
Laravel Akeneo images
This package is used to download images from a storage disk configured in the config/filesystems.php
of your Laravel
project and upload them to your Akeneo PIM.
How it works
The process of setting images in Akeneo consists of two steps.
In order to set images, the disk and path are saved with a checksum of the file in the database. This way we prevent uploading the same image over and over again.
Next, the image will be uploaded. By using the information stored in the database, the data is sent over to Akeneo.
Installation
You can install the package via composer.
composer require justbetter/laravel-akeneo-images
Setup
If you wish to configure the queue
of jobs, publish the configuration of this package.
php artisan vendor:publish --provider="JustBetter\AkeneoImages\ServiceProvider" --tag=config
Configuration
Make sure you have a disk configured in your config/filesystems.php
.
Set up your Akeneo connection. More information can be found here.
Implementation
In order to start processing images, the ProcessImageJob
has to be dispatched. This is the only thing you'll have to
do when using the default functionalities.
<?php use JustBetter\AkeneoImages\Jobs\ProcessImageJob; ProcessImageJob::dispatch('disk', '/path/to/image.jpeg', [ 'identifier' => 'sku', 'attribute' => 'image', 'type' => 'product', 'scope' => null, 'locale' => null, ]);
The third parameter is an array which represents the $meta
. This is used in the UploadImageJob
in order to determine
where the image has to be uploaded to.
The UploadImageJob
is automatically dispatched by the ProcessImage
action when the image passes validation, so there
is no need to dispatch this manually.
Commands
This package also ships with a few commands.
php artisan akeneo-image:process {disk} {path} {--force} php artisan akeneo-image:upload {image-id}
Quality
To ensure the quality of this package, run the following command:
composer quality
This will execute three tasks:
- Makes sure all tests are passed
- Checks for any issues using static code analysis
- Checks if the code is correctly formatted
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.