PHPackages                             nmirceac/api-client-tools - 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. nmirceac/api-client-tools

ActiveLibrary[API Development](/categories/api)

nmirceac/api-client-tools
=========================

API Client Tools for Laravel

0.1.3.3(1y ago)0322proprietaryPHPPHP &gt;=5.4.0

Since Jan 14Pushed 1y ago1 watchersCompare

[ Source](https://github.com/nmirceac/apiClientTools)[ Packagist](https://packagist.org/packages/nmirceac/api-client-tools)[ Docs](https://github.com/nmirceac/apiClientTools)[ RSS](/packages/nmirceac-api-client-tools/feed)WikiDiscussions master Synced 6d ago

READMEChangelog (10)Dependencies (1)Versions (34)Used By (0)

apiClientTools
==============

[](#apiclienttools)

API Client Tools

Contents
--------

[](#contents)

1. Intro
2. Examples

1. Intro
========

[](#1-intro)

How to install?
---------------

[](#how-to-install)

- composer require nmirceac/api-client-tools
- php artisan vendor:publish
- check config/api-client.php (just in case)
- add your API details to .env
- php artisan apitools:publish - to generate the models
- check the examples below
- enjoy!

Samples
-------

[](#samples)

### .env sample config

[](#env-sample-config)

```
API_CLIENT_BASE_NAMESPACE="Api"
API_CLIENT_BASE_URL="https://admin-collaboration.weanswer.it/"
API_CLIENT_SECRET="FTPU6jA3YIqELg8XKI*****************"
API_CLIENT_COLOR_TOOLS_AUTODETECT=true
API_CLIENT_COLOR_TOOLS_PUBLIC_PATTERN="images/%hash%"
API_CLIENT_SEND_AUTH=true
API_CLIENT_SEND_LOCALE=true
API_CLIENT_IGNORE_SSL_HOST=false
API_CLIENT_IGNORE_SSL_ERRORS=false

```

2. Examples
===========

[](#2-examples)

ColorTools images support
-------------------------

[](#colortools-images-support)

Objects are scanned for \\ColorTools\\ImageStore objects that are hydrated to a \\ApiClientTools\\App\\ApiImageStore object

```
return \App\Api\Project::get(3)['thumbnail'];
// ApiClientTools\App\ApiImageStore {#284 ▼
//  +modifierString: null
//  +"id": 22
//  +"hash": "db16b0f3fe1533135914df5fa455e3c5"
//  +"name": "Collaboration Maersk 001"
//  +"type": "jpeg"
//  +"size": 48227
//  +"width": 471
//  +"height": 471
//  +"metadata": array:12 [▶]
//  +"colors": array:5 [▶]
//  +"created_at": "2019-12-12 14:37:06"
//  +"updated_at": "2019-12-12 14:37:08"
//  +"canDelete": true
//  +"orientation": "L"
//  +"basename": "Collaboration Maersk 001.jpeg"
//  +"details": array:1 [▶]
//  +"pivot": array:6 [▶]
//  +"url": "https://admin-collaboration.weanswer.it/images/db16b0f3fe1533135914df5fa455e3c5.jpeg"
//}
```

All the objects have a `url` property to their full size URL

```
return \App\Api\Project::get(3)['thumbnail']->url;
// https://admin-collaboration.weanswer.it/images/db16b0f3fe1533135914df5fa455e3c5.jpeg
```

The objects will have modifying and publishing methods similar to a \\ColorTools\\ImageStore object

You can apply modifiers and then publish

```
$thumbnail=\App\Api\Project::get(3)['thumbnail'];
$thumbnail->modifyImage(function(\ColorTools\Image $img) {
    $img->fit(100, 100);
});
return $thumbnail->publish();
// https://admin-collaboration.weanswer.it/images/db16b0f3fe1533135914df5fa455e3c5-ft=100+100.jpeg
```

The modifier is only a mutator that returns the object

```
$thumbnail=\App\Api\Project::get(3)['thumbnail'];
return $thumbnail->modifyImage(function(\ColorTools\Image $img) {
    $img->fit(100, 100);
})->publish();
// https://admin-collaboration.weanswer.it/images/db16b0f3fe1533135914df5fa455e3c5-ft=100+100.jpeg
```

The publishing format can be overridden

```
$thumbnail=\App\Api\Project::get(3)['thumbnail'];
return $thumbnail->modifyImage(function(\ColorTools\Image $img) {
    $img->fit(100, 100);
})->publish('png');
// https://admin-collaboration.weanswer.it/images/db16b0f3fe1533135914df5fa455e3c5-ft=100+100.png
```

You can also modify and publish in one go

```
$thumbnail=\App\Api\Project::get(3)['thumbnail'];
$thumbnail->modifyImagePublish(function(\ColorTools\Image $img) {
    $img->fit(100, 100);
});
// https://admin-collaboration.weanswer.it/images/db16b0f3fe1533135914df5fa455e3c5-ft=100+100.png
```

And do that while specifying the publishing format

```
$thumbnail=\App\Api\Project::get(3)['thumbnail'];
$thumbnail->modifyImagePublish(function(\ColorTools\Image $img) {
    $img->fit(100, 100);
}, 'png');
// https://admin-collaboration.weanswer.it/images/db16b0f3fe1533135914df5fa455e3c5-ft=100+100.png
```

Thumbnails support
------------------

[](#thumbnails-support)

Non image thumbnails are also supported through a similar syntax. Just make sure you remove the typehint as the passed object to the close might not be an image.

```
$thumbnail=\App\Api\Project::get(2)['thumbnail'];
$thumbnail->modifyImagePublish(function($img) {
    $img->fit(100, 100);
});
// https://admin-collaboration.weanswer.it/thumbnail/project/2-s=100x100.jpeg
```

or

```
$thumbnail=\App\Api\Project::get(2)['thumbnail'];
$thumbnail->modifyImagePublish(function($img) {
    $img->fit(400, 270);
}, 'png');
// https://admin-collaboration.weanswer.it/thumbnail/project/2-s=400x270.png
```

Just note that only the `fit` method is supported at the moment - all the other methods are gracefully ignored

```
$thumbnail=\App\Api\Project::get(2)['thumbnail'];
$thumbnail->modifyImagePublish(function($img) {
    $img->fit(400, 270);
    $img->applyFilter(\ColorTools\Image::FILTER_GRAYSCALE);
});
// https://admin-collaboration.weanswer.it/thumbnail/project/2-s=400x270.jpeg

$thumbnail=\App\Api\Project::get(4)['thumbnail'];
$thumbnail->modifyImagePublish(function($img) {
    $img->fit(400, 270);
    $img->applyFilter(\ColorTools\Image::FILTER_GRAYSCALE);
});
// https://admin-collaboration.weanswer.it/images/45771d1cdfe109aa6e5b3fd48c925ebd-fi=1+-ft=400+270.jpeg
```

File payload helper methods
---------------------------

[](#file-payload-helper-methods)

Now you can easy attach FileTools compatible file payloads with two helper methods

```
// you can create the payload from a file path
$filePayloadFromPath=\App\Api\Project::createFileFromPath('/path/to/file.extension');
// or from a request
$filePayloadFromRequest=\App\Api\Extension::createFileFromRequest(request(), 'file');

// you can also optionally specify the individual file role or order
$anotherFilePayload==\App\Api\Project::createFileFromPath('/path/to/another.file', 'guide', 1);

// you can then just upload the files to the proper endpoing
\App\Api\Endpoint::attachFile($id, ['files'=>[$filePayloadFromPath, $filePayloadFromRequest, $anotherFilePayload]]);

// you can also create the file from string and populate your own metadata
\App\Api\Endpoint::createFilePayload($metadata, $fileContents);

$metadata should contain at least name, mime, extension and size
```

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity53

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

Recently: every ~131 days

Total

33

Last Release

558d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f33db7410a199079d0bf367c8e79987d3fe424840844d415293c14a4cf9e369a?d=identicon)[nmirceac](/maintainers/nmirceac)

---

Tags

apilaravellaravel-apicolorToolsapiToolsapiClientTools

### Embed Badge

![Health badge](/badges/nmirceac-api-client-tools/health.svg)

```
[![Health](https://phpackages.com/badges/nmirceac-api-client-tools/health.svg)](https://phpackages.com/packages/nmirceac-api-client-tools)
```

###  Alternatives

[specialtactics/laravel-api-boilerplate

An API boilerplate for Laravel

5451.5k](/packages/specialtactics-laravel-api-boilerplate)[wayofdev/laravel-symfony-serializer

📦 Laravel wrapper around Symfony Serializer.

2113.6k](/packages/wayofdev-laravel-symfony-serializer)[rakibdevs/openweather-laravel-api

Laravel package to connect https://openweathermap.org/ to get customized weather data for any location on the globe immediately

7648.2k](/packages/rakibdevs-openweather-laravel-api)

PHPackages © 2026

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