PHPackages                             stesa/cloudlinker-laravel-client - 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. stesa/cloudlinker-laravel-client

ActiveLibrary[API Development](/categories/api)

stesa/cloudlinker-laravel-client
================================

Laravel package for integrating with the Cloudlinker.eu API - connect printers, scanners, scales and IoT devices to your Laravel application

v1.0.5(6mo ago)04MITPHPPHP ^8.2CI passing

Since Dec 17Pushed 6mo agoCompare

[ Source](https://github.com/ssamoy/cloudlinker-laravel-client)[ Packagist](https://packagist.org/packages/stesa/cloudlinker-laravel-client)[ RSS](/packages/stesa-cloudlinker-laravel-client/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (4)Versions (7)Used By (0)

Cloudlinker Laravel Client
==========================

[](#cloudlinker-laravel-client)

[![Tests](https://github.com/ssamoy/cloudlinker-laravel-client/actions/workflows/tests.yml/badge.svg)](https://github.com/ssamoy/cloudlinker-laravel-client/actions)[![Latest Stable Version](https://camo.githubusercontent.com/71103ab9918936469a437390327dffbfdfc7088a2d160f90f937b29a0a082d41/68747470733a2f2f706f7365722e707567782e6f72672f73746573612f636c6f75646c696e6b65722d6c61726176656c2d636c69656e742f76)](https://packagist.org/packages/stesa/cloudlinker-laravel-client)[![License](https://camo.githubusercontent.com/6d10c2af0f20c48d7e641ab8200f872caba128529806c92756851a2f2cd02f6e/68747470733a2f2f706f7365722e707567782e6f72672f73746573612f636c6f75646c696e6b65722d6c61726176656c2d636c69656e742f6c6963656e7365)](https://packagist.org/packages/stesa/cloudlinker-laravel-client)

Laravel package for integrating with the [Cloudlinker.eu](https://cloudlinker.eu) API. Connect printers, scanners, scales and IoT devices to your Laravel application.

Requirements
------------

[](#requirements)

- PHP 8.2+
- Laravel 10.x, 11.x or 12.x

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

[](#installation)

Install the package via Composer:

```
composer require stesa/cloudlinker-laravel-client
```

Publish the configuration file:

```
php artisan vendor:publish --tag=cloudlinker-config
```

Add your Cloudlinker credentials to your `.env` file:

```
CLOUDLINKER_ORG_ID=your-organisation-id
CLOUDLINKER_API_KEY=your-api-key
```

Usage
-----

[](#usage)

### Using the Facade

[](#using-the-facade)

```
use Stesa\CloudlinkerClient\Facades\Cloudlinker;

// Test the connection
Cloudlinker::test();

// List all clients (registered by Cloudlinker software)
$clients = Cloudlinker::clients()->list();

// Get all clients (auto-paginated)
$allClients = Cloudlinker::clients()->all();

// Filter clients by hostname
$clients = Cloudlinker::clients()->list(hostname: 'office-pc');

// Delete a client
Cloudlinker::clients()->delete('client-uuid');
```

### Working with Devices

[](#working-with-devices)

```
// List devices for a client
$devices = Cloudlinker::devices()->list('client-uuid');

// Get all devices for a client (auto-paginated)
$allDevices = Cloudlinker::devices()->all('client-uuid');

// Delete a device
Cloudlinker::devices()->delete('device-uuid');
```

### Working with Jobs

[](#working-with-jobs)

```
// Create a print job
$job = Cloudlinker::jobs()->create([
    'client_id' => 'client-uuid',
    'device_id' => 'device-uuid',
    'job_type' => 1, // 1 = PRINTJOB
    'payload' => json_encode([
        'document_type' => 'pdf',
        'document_url' => 'https://example.com/document.pdf',
        'copies' => 1,
    ]),
]);

// Launch a job
$job = Cloudlinker::jobs()->launch('job-uuid');

// Create and immediately launch a job
$job = Cloudlinker::jobs()->create([
    'client_id' => 'client-uuid',
    'device_id' => 'device-uuid',
    'job_type' => 1,
    'payload' => json_encode([
        'document_type' => 'pdf',
        'document_url' => 'https://example.com/document.pdf',
        'copies' => 1,
    ]),
    'launch_immediately' => true,
]);

// Delete a job
Cloudlinker::jobs()->delete('job-uuid');
```

### Job Types

[](#job-types)

TypeValueDescriptionPRINT`print`Print a PDF document to a printerHTTP\_COMMAND`http_command`Execute an HTTP request from the client machine### Print Jobs

[](#print-jobs)

```
$job = Cloudlinker::jobs()->createAndLaunch([
    'device_id' => 'device-uuid',
    'type' => 'print',
    'source' => 'https://example.com/document.pdf',
    'options' => [
        'copies' => 1,
    ],
]);
```

### HTTP\_COMMAND Jobs

[](#http_command-jobs)

HTTP\_COMMAND jobs execute HTTP requests from the Cloudlinker client machine, allowing access to internal network resources that may not be accessible from the internet.

```
// Simple GET request
$job = Cloudlinker::jobs()->createAndLaunchHttpCommand(
    clientId: 'client-uuid',
    targetUrl: 'https://internal-api.local/status',
    method: 'GET'
);

// POST request with parameters
$job = Cloudlinker::jobs()->createAndLaunchHttpCommand(
    clientId: 'client-uuid',
    targetUrl: 'https://internal-api.local/webhook',
    method: 'POST',
    parameters: [
        'event' => 'order_created',
        'order_id' => '12345',
    ]
);

// Request with Bearer authentication
$job = Cloudlinker::jobs()->createAndLaunchHttpCommand(
    clientId: 'client-uuid',
    targetUrl: 'https://api.example.com/data',
    method: 'GET',
    authentication: 'bearer',
    bearerToken: 'your-api-token'
);

// Request with Basic authentication
$job = Cloudlinker::jobs()->createAndLaunchHttpCommand(
    clientId: 'client-uuid',
    targetUrl: 'https://secure-api.local/endpoint',
    method: 'POST',
    authentication: 'basic',
    username: 'user',
    password: 'secret'
);

// Request with custom headers
$job = Cloudlinker::jobs()->createAndLaunchHttpCommand(
    clientId: 'client-uuid',
    targetUrl: 'https://api.example.com/data',
    method: 'GET',
    headers: [
        'X-Custom-Header' => 'value',
        'Accept' => 'application/json',
    ]
);

// Full control with raw create method
$job = Cloudlinker::jobs()->create([
    'client_id' => 'client-uuid',
    'job_type' => 2,  // 2 = HTTP_COMMAND
    'payload' => json_encode([
        'http_target_url' => 'https://api.example.com/webhook',
        'http_method' => 'POST',
        'http_headers' => ['Content-Type' => 'application/json'],
        'http_parameters' => ['key' => 'value'],
        'http_authentication' => 'bearer',
        'http_bearer_token' => 'your-token',
        'http_callback_method' => 'webhook',
        'http_webhook_url' => 'https://your-app.com/callback',
        'http_webhook_method' => 'POST',
    ]),
]);
```

#### Reading HTTP\_COMMAND Results

[](#reading-http_command-results)

```
// Check job completion
if ($job->isCompleted()) {
    // Get HTTP response details
    $statusCode = $job->getHttpStatus();      // e.g., 200
    $responseBody = $job->getHttpResult();    // Response body as string

    // Check if request was successful (2xx status)
    if ($job->isHttpSuccess()) {
        echo "Request succeeded!";
    }

    // If webhook was configured
    $webhookStatus = $job->getWebhookHttpStatus();
    $webhookResult = $job->getWebhookHttpResult();
}
```

### Using Dependency Injection

[](#using-dependency-injection)

```
use Stesa\CloudlinkerClient\CloudlinkerClient;

class PrintController extends Controller
{
    public function print(CloudlinkerClient $cloudlinker)
    {
        // Get the first available client and device
        $clients = $cloudlinker->clients()->all();
        $devices = $cloudlinker->devices()->all($clients[0]->id);

        $job = $cloudlinker->jobs()->create([
            'client_id' => $clients[0]->id,
            'device_id' => $devices[0]->id,
            'job_type' => 1,
            'payload' => json_encode([
                'document_type' => 'pdf',
                'document_url' => 'https://example.com/invoice.pdf',
                'copies' => 1,
            ]),
            'launch_immediately' => true,
        ]);

        return response()->json(['job_id' => $job->id]);
    }
}
```

Events
------

[](#events)

The package dispatches events when API actions are performed:

EventDescription`ClientDeleted`Fired when a client is deleted`DeviceDeleted`Fired when a device is deleted`JobCreated`Fired when a job is created`JobLaunched`Fired when a job is launched`JobDeleted`Fired when a job is deleted### Listening to Events

[](#listening-to-events)

```
// In your EventServiceProvider
use Stesa\CloudlinkerClient\Events\JobLaunched;

protected $listen = [
    JobLaunched::class => [
        SendPrintNotification::class,
    ],
];
```

Artisan Commands
----------------

[](#artisan-commands)

```
# Test your API connection
php artisan cloudlinker:test

# List all clients
php artisan cloudlinker:clients

# Filter clients by hostname
php artisan cloudlinker:clients --hostname=office

# Test an HTTP_COMMAND job (uses first available client)
php artisan cloudlinker:http-test https://httpbin.org/get

# HTTP_COMMAND with specific client
php artisan cloudlinker:http-test https://httpbin.org/get --client=client-uuid

# HTTP_COMMAND with POST method
php artisan cloudlinker:http-test https://httpbin.org/post --method=POST

# HTTP_COMMAND with Bearer token
php artisan cloudlinker:http-test https://api.example.com/data --bearer=your-token

# HTTP_COMMAND with custom headers and parameters
php artisan cloudlinker:http-test https://api.example.com/endpoint \
    --method=POST \
    --header="Content-Type: application/json" \
    --header="X-Custom: value" \
    --param="key=value" \
    --param="another=param"
```

DTOs
----

[](#dtos)

The package uses Data Transfer Objects for type-safe data handling:

```
use Stesa\CloudlinkerClient\DTOs\Client;
use Stesa\CloudlinkerClient\DTOs\Device;
use Stesa\CloudlinkerClient\DTOs\Job;

// Client properties
$client->id;
$client->hostname;
$client->description;
$client->ipAddress;
$client->lastSeen;
$client->isOnline(); // true if last_seen is within 5 minutes

// Device properties
$device->id;
$device->clientId;
$device->name;
$device->hardwarePath;
$device->additionalInfo;

// Job properties
$job->id;
$job->clientId;
$job->deviceId;
$job->deviceName;
$job->jobType;              // Job::TYPE_PRINT (1) or Job::TYPE_HTTP_COMMAND (2)
$job->statusCode;           // Job::STATUS_CREATED (1) through STATUS_FAILED (5)
$job->payload;              // Parsed job payload as array
$job->result;               // Parsed result as array
$job->error;
$job->createdAt;

// Job status helpers
$job->isCreated();
$job->isLaunched();
$job->isPending();
$job->isProcessing();       // true if launched or pending
$job->isCompleted();
$job->isFailed();
$job->getStatusName();      // 'created', 'launched', 'pending', 'completed', 'failed'

// Job type helpers
$job->isPrintJob();
$job->isHttpCommand();
$job->getTypeName();        // 'print' or 'http_command'

// HTTP_COMMAND result helpers
$job->getHttpStatus();         // HTTP status code (e.g., 200)
$job->getHttpResult();         // Response body
$job->isHttpSuccess();         // true if status 2xx
$job->getWebhookHttpStatus();  // Webhook callback status
$job->getWebhookHttpResult();  // Webhook callback response
```

Exception Handling
------------------

[](#exception-handling)

The package throws specific exceptions for different error types:

```
use Stesa\CloudlinkerClient\Exceptions\AuthenticationException;
use Stesa\CloudlinkerClient\Exceptions\CloudlinkerException;
use Stesa\CloudlinkerClient\Exceptions\NotFoundException;
use Stesa\CloudlinkerClient\Exceptions\QuotaExceededException;
use Stesa\CloudlinkerClient\Exceptions\RateLimitException;
use Stesa\CloudlinkerClient\Exceptions\ValidationException;

try {
    Cloudlinker::jobs()->create($data);
} catch (AuthenticationException $e) {
    // Invalid credentials (401)
} catch (ValidationException $e) {
    // Validation errors (422)
    $errors = $e->getErrors();
} catch (NotFoundException $e) {
    // Resource not found (404)
} catch (QuotaExceededException $e) {
    // Quota exceeded (e.g., maximum daily jobs reached)
} catch (RateLimitException $e) {
    // Rate limit exceeded (429)
    $retryAfter = $e->getRetryAfter();
} catch (CloudlinkerException $e) {
    // Other API errors
}
```

Configuration
-------------

[](#configuration)

```
// config/cloudlinker.php

return [
    // Your Cloudlinker organisation ID
    'organisation_id' => env('CLOUDLINKER_ORG_ID'),

    // Your Cloudlinker API key
    'api_key' => env('CLOUDLINKER_API_KEY'),

    // API base URL (change only for staging/testing)
    'base_url' => env('CLOUDLINKER_URL', 'https://cloudlinker.eu/api'),

    // Request timeout in seconds
    'timeout' => env('CLOUDLINKER_TIMEOUT', 30),
];
```

Testing
-------

[](#testing)

```
composer test
```

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance66

Regular maintenance activity

Popularity3

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

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 ~0 days

Total

6

Last Release

198d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/10151610?v=4)[ssamoy](/maintainers/ssamoy)[@ssamoy](https://github.com/ssamoy)

---

Tags

printerapilaravelscaleiotscannercloudlinker

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/stesa-cloudlinker-laravel-client/health.svg)

```
[![Health](https://phpackages.com/badges/stesa-cloudlinker-laravel-client/health.svg)](https://phpackages.com/packages/stesa-cloudlinker-laravel-client)
```

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M3.1k](/packages/craftcms-cms)[simplestats-io/laravel-client

Server-side analytics for Laravel that follows the full funnel from visit to registration to payment, attributed to the channel that drove it. Revenue, MRR, churn and ad-spend profit (ROAS/CAC) per channel. GDPR compliant, ad-blocker proof.

5021.9k](/packages/simplestats-io-laravel-client)[smodav/mpesa

M-Pesa API implementation

16467.9k1](/packages/smodav-mpesa)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

273.0k](/packages/eslazarev-wildberries-sdk)[files.com/files-php-sdk

Files.com PHP SDK

2481.1k](/packages/filescom-files-php-sdk)

PHPackages © 2026

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