PHPackages                             ahmedsaoud31/larareviews - 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. ahmedsaoud31/larareviews

ActiveLibrary

ahmedsaoud31/larareviews
========================

Unified Laravel package to aggregate, manage, and render reviews from TripAdvisor, Viator, GetYourGuide, Google Reviews, and custom platforms on tour and activity pages.

00PHP

Since Aug 1Pushed todayCompare

[ Source](https://github.com/ahmedsaoud31/larareviews)[ Packagist](https://packagist.org/packages/ahmedsaoud31/larareviews)[ RSS](/packages/ahmedsaoud31-larareviews/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

LaraReviews - Multi-Platform Review Management for Laravel
==========================================================

[](#larareviews---multi-platform-review-management-for-laravel)

**LaraReviews** is a unified Laravel package designed to aggregate, manage, link, and display reviews from **TripAdvisor**, **Viator**, **GetYourGuide**, **Google Reviews**, and custom sources directly on tour, activity, or hotel pages.

---

Features
--------

[](#features)

- 🔗 **Tour Mapping (`HasReviews` Trait)**: Easily connect any local Laravel model (e.g. `App\Models\Tour`) to external review platform entities (TripAdvisor location ID, Viator product code, etc.).
- 🔌 **Driver-Based Architecture**: Modular drivers for TripAdvisor, Viator, GetYourGuide, Google Places, and Custom/Manual reviews.
- ⚡ **Auto-Sync &amp; CLI Commands**: Sync reviews on-demand, scheduled, or via queued jobs (`php artisan larareviews:sync`).
- 📊 **Aggregate Ratings &amp; Breakdown**: Combined overall score, star distribution percentages, and platform-specific summaries.
- 🎨 **Modern Blade Components**: Ready-to-use ``, ``, ``, ``, and ``.
- 🔍 **Google SEO Rich Snippets**: Built-in JSON-LD `AggregateRating` and `Review` schema generator.

---

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

[](#installation)

Add the package to your Laravel application `composer.json` or local packages repository:

```
composer require ahmedsaoud31/larareviews:dev-main
```

Publish configuration and run migrations:

```
php artisan vendor:publish --tag="larareviews-config"
php artisan vendor:publish --tag="larareviews-migrations"
php artisan migrate
```

---

Usage Guide
-----------

[](#usage-guide)

### 1. Attach `HasReviews` Trait to your Tour Model

[](#1-attach-hasreviews-trait-to-your-tour-model)

```
namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use LaraReviews\Traits\HasReviews;

class Tour extends Model
{
    use HasReviews;

    // ...
}
```

### 2. Connect Tour to External Review Platforms

[](#2-connect-tour-to-external-review-platforms)

You can connect your local tour to external review platforms programmatically or via CLI:

#### Programmatically:

[](#programmatically)

```
$tour = Tour::find(1);

// Connect TripAdvisor
$tour->connectReviewPlatform(
    platform: 'tripadvisor',
    externalId: '1234567',
    externalUrl: 'https://www.tripadvisor.com/Attraction_Review-g1234567.html'
);

// Connect Viator
$tour->connectReviewPlatform(
    platform: 'viator',
    externalId: 'P12345',
    externalUrl: 'https://www.viator.com/tours/p-12345'
);

// Connect Google Places
$tour->connectReviewPlatform(
    platform: 'google',
    externalId: 'ChIJN1t_tDeuEmsRUsoyG83frY4'
);
```

#### Via Artisan CLI:

[](#via-artisan-cli)

```
php artisan larareviews:link "App\Models\Tour" 1 tripadvisor 1234567 --url="https://tripadvisor.com/..."
```

---

### 3. Sync Reviews

[](#3-sync-reviews)

To sync reviews manually or in a cron job:

```
php artisan larareviews:sync
```

Optionally filter by platform or model:

```
php artisan larareviews:sync --platform=tripadvisor --model="App\Models\Tour"
```

Or dispatch via queued background job:

```
use LaraReviews\Jobs\SyncModelReviewsJob;

SyncModelReviewsJob::dispatch($tour);
```

---

### 4. Display Reviews on Tour Pages (Blade Components)

[](#4-display-reviews-on-tour-pages-blade-components)

#### A. Full Review List with Filters &amp; Badges

[](#a-full-review-list-with-filters--badges)

```

```

#### B. Summary &amp; Rating Distribution Box

[](#b-summary--rating-distribution-box)

```

```

#### C. Responsive Card Grid

[](#c-responsive-card-grid)

```

```

#### D. Compact Rating Badge (For Tour Cards / Lists)

[](#d-compact-rating-badge-for-tour-cards--lists)

```

```

#### E. SEO Rich Snippet Schema (JSON-LD)

[](#e-seo-rich-snippet-schema-json-ld)

Place inside the `` of your tour page:

```

```

---

Configuration (`config/larareviews.php`)
----------------------------------------

[](#configuration-configlarareviewsphp)

```
return [
    'default' => 'tripadvisor',

    'drivers' => [
        'tripadvisor' => [
            'api_key' => env('TRIPADVISOR_API_KEY'),
        ],
        'viator' => [
            'api_key' => env('VIATOR_API_KEY'),
        ],
        'google' => [
            'api_key' => env('GOOGLE_PLACES_API_KEY'),
        ],
    ],
];
```

---

License
-------

[](#license)

The MIT License (MIT).

###  Health Score

20

↑

LowBetter than 12% of packages

Maintenance65

Regular maintenance activity

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity11

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://avatars.githubusercontent.com/u/4484348?v=4)[أحمد أبوالسعود](/maintainers/ahmedsaoud31)[@ahmedsaoud31](https://github.com/ahmedsaoud31)

---

Top Contributors

[![ahmedsaoud31](https://avatars.githubusercontent.com/u/4484348?v=4)](https://github.com/ahmedsaoud31 "ahmedsaoud31 (13 commits)")

### Embed Badge

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

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

PHPackages © 2026

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