PHPackages                             carthooks/carthooks - 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. carthooks/carthooks

ActiveLibrary

carthooks/carthooks
===================

A library used to access Carthooks.

0136PHP

Since Feb 29Pushed 2y ago1 watchersCompare

[ Source](https://github.com/carthooks/client-php)[ Packagist](https://packagist.org/packages/carthooks/carthooks)[ RSS](/packages/carthooks-carthooks/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

install
-------

[](#install)

```
composer require carthooks/carthooks
```

usage
-----

[](#usage)

```
use Carthooks\CartHooksClient;

$client = new CartHooksClient($api_key, $api_secret);
```

### Get items

[](#get-items)

```
    $items = $client->getItems($app_id, $collection_id, [
        'fields' => [],
        'filters' => [
            'age' => [
                '$eq' => '16',
            ],
        ],
        'sort' => ['age'],
        'pagination' => [
            'page' => 1,
            'pageSize' => 10,
        ],
    ]);
```

### Get item

[](#get-item)

```
    $item = $client->getItem($app_id, $collection_id, $item_id);
```

### Create item

[](#create-item)

```
    $item = $client->createItem($app_id, $collection_id, [
        'name' => 'test',
        'age' => 16,
    ]);
```

### Update item

[](#update-item)

```
    $item = $client->updateItem($app_id, $collection_id, $item_id, [
        'name' => 'test',
        'age' => 16,
    ]);
```

### Upload assets

[](#upload-assets)

```
    $token = $client->getUploadToken(); //auto expire after 30 minutes
    $tempAsset = $client->upload($token, $_FILES['myFile']['tmp_name']); //will auto delete after 30 minutes, if not bind to item

    $item = $client->updateItem($app_id, $collection_id, $item_id, [
        'name' => 'test',
        'age' => 16,
        'photo' => $tempAsset, //bind assets
    ]);
```

### Upload use frontend

[](#upload-use-frontend)

```
Route::get('/upload-token', function () {
    $client = new CartHooksClient($api_key, $api_secret);
    $token = $client->getUploadToken();
    return $token;
});
```

```
npm i carthooks-upload

```

```

        upload

import axios from 'axios';
import upload from 'carthooks-upload'
export default {
    data() {
        return {
            limit: 1,
            token: null,
        }
    },
    methods: {
        uploadFunction(item) {
            upload(this.token, item.file, {
                onProgress: (p) => {
                    item.onProgress({ percent: Math.floor(p * 100) });
                }
            }).then((res) => {
                this.$message.success('upload success')
            }).catch((e) => {
                this.$message.error('upload error')
            })
        },
        async beforeUpload(file) {
            await axios.get('/upload-token').then(res => {
                this.token = res.data;
            })
        },
    }
}

```

###  Health Score

15

—

LowBetter than 3% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity19

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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.

### Community

Maintainers

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

---

Top Contributors

[![flaboy](https://avatars.githubusercontent.com/u/486890?v=4)](https://github.com/flaboy "flaboy (8 commits)")

### Embed Badge

![Health badge](/badges/carthooks-carthooks/health.svg)

```
[![Health](https://phpackages.com/badges/carthooks-carthooks/health.svg)](https://phpackages.com/packages/carthooks-carthooks)
```

PHPackages © 2026

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