# fluent-cart/1.6.4/api/Invokable/ImageAttach.php

FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler, version 1.6.4. 22 lines.

- Page: https://pluginprobe.com/plugins/fluent-cart/1.6.4/code/api/Invokable/ImageAttach.php
- Raw: https://pluginprobe.com/plugins/fluent-cart/1.6.4/raw/api/Invokable/ImageAttach.php
- Modified: 2025-10-14T16:36:46+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/fluent-cart/1.6.4/code/api/Invokable/ImageAttach.php#L10-L20`.

```php
<?php

namespace FluentCart\Api\Invokable;

use FluentCart\App\Services\Async\ImageAttachService;
use FluentCart\Framework\Support\Arr;

class ImageAttach
{
    public function __invoke($app, $params)
    {
        $method = Arr::get($params, 'method');
        $data = Arr::get($params, 'data');
        $images = Arr::get($params, 'images');

        if ($method === 'attachImageToVariant') {
            ImageAttachService::attachImageToVariant($data, $images);
        } else if ($method === 'attachImageToProduct') {
            ImageAttachService::attachImageToProduct($data, $images);
        }
    }
}
```
