PHPackages                             mccaulay/laravel-trustpilot - 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. mccaulay/laravel-trustpilot

ActiveLibrary[API Development](/categories/api)

mccaulay/laravel-trustpilot
===========================

Laravel PHP library for Trustpilot's API

1.0.8(9mo ago)420.5k10MITPHPPHP ^7.1.3|^8.0|^8.1

Since Mar 20Pushed 9mo ago2 watchersCompare

[ Source](https://github.com/igdwebdev/laravel-trustpilot)[ Packagist](https://packagist.org/packages/mccaulay/laravel-trustpilot)[ Docs](https://github.com/igdwebdev/laravel-trustpilot)[ RSS](/packages/mccaulay-laravel-trustpilot/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (5)Versions (10)Used By (0)

Laravel Trustpilot PHP API
==========================

[](#laravel-trustpilot-php-api)

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

[](#installation)

You can install the package via composer:

```
composer require igdwebdev/laravel-trustpilot
```

Official Documentation
----------------------

[](#official-documentation)

- [Trustpilot Documentation](https://developers.trustpilot.com/)

Environment Variables
---------------------

[](#environment-variables)

```
TRUSTPILOT_UNIT_ID=
TRUSTPILOT_API_KEY=
TRUSTPILOT_API_SECRET=
TRUSTPILOT_USERNAME=
TRUSTPILOT_PASSWORD=

```

TO-DO
-----

[](#to-do)

- Consumer API
- Consumer Profile API
- Product Reviews API -&gt; Conversations, Invitation Link
- Resources API
- Service Reviews API
- Business Units API (Private Reviews)

Usage
-----

[](#usage)

### Business Unit

[](#business-unit)

```
// Get the first business unit
$businessUnit = Trustpilot::businessUnits()->first();

// Get the 2nd page of business units with 5 per page.
$businessUnits = Trustpilot::businessUnits()
    ->limit(5)
    ->page(2)
    ->get();

// Search for the first business unit with the name 'Trustpilot'
$businessUnit = Trustpilot::businessUnits()
    ->search('Trustpilot')
    ->first();

// Get business unit by id
$businessUnit = Trustpilot::businessUnits()->find('46d6a890000064000500e0c3');

// Get the first business unit's first review
$review = Trustpilot::businessUnits()
    ->first()
    ->reviews()
    ->first();

// Get the logo of the searched business.
$logo = Trustpilot::businessUnits()
    ->search('Trustpilot')
    ->first()
    ->logo();

// Get three of your business reviews ordered by lowest star to highest.
$reviews = Trustpilot::businessUnit()
    ->reviews()
    ->orderBy('stars', 'asc')
    ->limit(3)
    ->get();

// Get one of your business reviews which is one star and has a response.
$review = Trustpilot::businessUnit()
    ->reviews()
    ->where('stars', 1)
    ->where('responded', true)
    ->first();

// Get the review title of 5 of your reviews offseted by 5.
$reviews = Trustpilot::businessUnit()
    ->reviews()
    ->limit(5)
    ->offset(5)
    ->get()
    ->pluck('title');

// Get the the first 10 product reviews of your business that are 4 or 5 stars for the specific products.
$productReviews = Trustpilot::businessUnit()
    ->products()->reviews()
    ->where('sku', [
        'product_1_sku_here',
        'product_2_sku_here',
    ])
    ->where('stars', [4, 5])
    ->limit(10)
    ->get();

// Get the joined product review summary of the two specific products for your business.
$productReviewSummary = Trustpilot::businessUnit()
    ->products()
    ->reviewSummary([
        'product_1_sku_here',
        'product_2_sku_here',
    ]);

// Get the joined product review summary of the two specific products for your business by URL.
$productReviewSummary = Trustpilot::businessUnit()
    ->products()
    ->reviewSummary([], [
        'https://www.example.com/product_1',
        'https://www.example.com/product_2',
    ]);

// Get the aggregated product review summary of the two specific products for your business.
$aggregatedProductReviewSummaries = Trustpilot::businessUnit()
    ->products()
    ->reviewAggregatedSummaries([
        'product_1_sku_here',
        'product_2_sku_here',
    ]);

// Get the batched product review summary of the two specific products for your business.
$productReviewSummaries = Trustpilot::businessUnit()
    ->products()
    ->reviewBatchSummaries([
        'product_1_sku_here',
        'product_2_sku_here',
    ]);

// Get three of your business imported reviews for the given product.
$reviews = Trustpilot::businessUnit()
    ->importedReviews()
    ->where('sku', 'product_sku_here')
    ->limit(3)
    ->get();

// Get five of your business imported reviews for the given products.
$reviews = Trustpilot::businessUnit()
    ->importedReviews()
    ->where('sku', [
        'product_1_sku_here',
        'product_2_sku_here',
    ])
    ->limit(5)
    ->get();

// Get the joined imported product review summary of the two specific products for your business.
$productReviewSummary = Trustpilot::businessUnit()
    ->products()
    ->importedReviewSummary([
        'product_1_sku_here',
        'product_2_sku_here',
    ]);

// Get the joined imported product review summary of the specific product for your business.
$productReviewSummary = Trustpilot::businessUnit()
    ->products()
    ->importedReviewSummary('product_1_sku_here');

// Get the web links of your business.
$webLinks = Trustpilot::businessUnit()->webLinks();

// Get the logo of your business.
$logo = Trustpilot::businessUnit()->logo();

// Get the customer guarantee of your business.
$customerGuarantee = Trustpilot::businessUnit()->customerGuarantee();

// Get the images of your business.
$images = Trustpilot::businessUnit()->images();

// Get the profile of your business.
$profile = Trustpilot::businessUnit()->profile();

// Get the promotion of your business.
$promotion = Trustpilot::businessUnit()->promotion();
```

### Products

[](#products)

```
// Get all products.
$products = Trustpilot::products()->get();

// Get the product with a sku of "samsung-galaxy-s10".
$product = Trustpilot::products()
    ->where('skus', 'samsung-galaxy-s10')
    ->first();

// Get all products with a sku of "samsung-galaxy-s8", "samsung-galaxy-s9" or "samsung-galaxy-s10".
$products = Trustpilot::products()
    ->where('skus', ['samsung-galaxy-s8', 'samsung-galaxy-s9', 'samsung-galaxy-s10'])
    ->get();

// Updating a product.
$product = Trustpilot::products()
    ->where('skus', 'samsung-galaxy-s10')
    ->first();
$product->title = 'Samsung Galaxy S10';
$product->price = '9.99';
$product->currency = 'USD';
$product->save();
```

### Inivitations

[](#inivitations)

```
// Create a service invitation to John Doe from Business Name now.
Trustpilot::businessUnit()->invitation()->service(
    '#123456', 'John Doe', 'john.doe@example.com',
    'no-reply@business.com', 'Business Name'
);

// Create a service invitation to John Doe from Business Name now to be sent
// in 5 days using a custom template id and to redirect to our website afterwards.
Trustpilot::businessUnit()->invitation()->service(
    '#123456', 'John Doe', 'john.doe@example.com',
    'no-reply@business.com', 'Business Name', 'support@business.com',
    now()->addDays(5), '507f191e810c19729de860ea',
    'https://example.com/',
);

// Create a product and service invitation from product skus.
Trustpilot::businessUnit()->invitation()->products(
    ['samsung-galaxy-s8', 'samsung-galaxy-s9', 'samsung-galaxy-s10'],
    '#123456', 'John Doe', 'john.doe@example.com',
    'no-reply@business.com', 'Business Name'
);

// Create a product and service invitation from products.
Trustpilot::businessUnit()->invitation()->products(
    [
        new Product([
            'sku' => 'samsung-galaxy-s8',
            'name' => 'Samsung Galaxy S8',
            'brand' => 'Samsung Galaxy',
            'productUrl' => 'https://example.com/products/samsung-galaxy-s8',
            'imageUrl' => 'https://example.com/products/images/samsung-galaxy-s8.jpg',
        ]),
        new Product([
            'sku' => 'samsung-galaxy-s10',
            'name' => 'Samsung Galaxy S10',
            'brand' => 'Samsung Galaxy',
            'productUrl' => 'https://example.com/products/samsung-galaxy-s10',
            'imageUrl' => 'https://example.com/products/images/samsung-galaxy-s10.jpg',
        ]),
    ],
    '#123456', 'John Doe', 'john.doe@example.com',
    'no-reply@business.com', 'Business Name'
);

// Get a list of templates available to be used in invitations.
$templates = Trustpilot::businessUnit()->invitation()->templates();

// Generate a service review invitation link.
$inviteUrl = Trustpilot::businessUnit()->invitation()->generateLink('#123456', 'John Doe', 'john.doe@example.com', 'https://example.com/');

// Delete all invitation data related to the given e-mails.
Trustpilot::businessUnit()->invitation()->deleteByEmails([
    'john.doe@example.com',
    'jane.doe@example.com',
]);

// Delete all invitation data older than 5 years.
Trustpilot::businessUnit()->invitation()->deleteBeforeDate(now()->subYears(5));
```

### Categories

[](#categories)

```
// Get all categories.
$categories = Trustpilot::categories()->get();

// Get categories with a parent of "banking_money".
$categories = Trustpilot::categories()
    ->where('parentId', 'banking_money')
    ->get();

// Get category by id.
$category = Trustpilot::categories()->find('trust_bank');

// Get first three business units with the same category as your business unit.
$businessUnits = Trustpilot::businessUnit()->categories()->first()->businessUnits()->limit(3)->get();
```

Credits
-------

[](#credits)

- [McCaulay Hudson](https://github.com/mccaulay)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

46

—

FairBetter than 93% of packages

Maintenance55

Moderate activity, may be stable

Popularity28

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity71

Established project with proven stability

 Bus Factor3

3 contributors hold 50%+ of commits

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

Recently: every ~485 days

Total

9

Last Release

298d ago

PHP version history (3 changes)v1.0.0PHP ^7.1.3

1.0.6PHP ^7.1.3|^8.0

1.0.7PHP ^7.1.3|^8.0|^8.1

### Community

Maintainers

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

---

Top Contributors

[![hasnatfelmo](https://avatars.githubusercontent.com/u/93522183?v=4)](https://github.com/hasnatfelmo "hasnatfelmo (4 commits)")[![jobbrown](https://avatars.githubusercontent.com/u/1885439?v=4)](https://github.com/jobbrown "jobbrown (3 commits)")[![lBodia](https://avatars.githubusercontent.com/u/20229941?v=4)](https://github.com/lBodia "lBodia (3 commits)")[![McCaulay](https://avatars.githubusercontent.com/u/31845045?v=4)](https://github.com/McCaulay "McCaulay (3 commits)")[![samjonesigd](https://avatars.githubusercontent.com/u/16079736?v=4)](https://github.com/samjonesigd "samjonesigd (3 commits)")[![tigitz](https://avatars.githubusercontent.com/u/1524501?v=4)](https://github.com/tigitz "tigitz (1 commits)")

---

Tags

laravelTrustpilotmccaulaylaravel-trustpilotigdwebdev

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mccaulay-laravel-trustpilot/health.svg)

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

###  Alternatives

[irazasyed/telegram-bot-sdk

The Unofficial Telegram Bot API PHP SDK

3.3k4.5M84](/packages/irazasyed-telegram-bot-sdk)[andreaselia/laravel-api-to-postman

Generate a Postman collection automatically from your Laravel API

1.0k586.2k3](/packages/andreaselia-laravel-api-to-postman)[mll-lab/laravel-graphiql

Easily integrate GraphiQL into your Laravel project

683.2M9](/packages/mll-lab-laravel-graphiql)[simplestats-io/laravel-client

Client for SimpleStats!

4515.5k](/packages/simplestats-io-laravel-client)[njoguamos/laravel-plausible

A laravel package for interacting with plausible analytics api.

208.8k](/packages/njoguamos-laravel-plausible)[dragon-code/laravel-json-response

Automatically always return a response in JSON format

1118.6k1](/packages/dragon-code-laravel-json-response)

PHPackages © 2026

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