---
title: "Installation — Reviews for Laravel | Roundly"
description: "Install via Composer, publish the publish-only migrations for reviews and media, and optionally the config, translations and resources."
url: https://roundly-consulting.com/open-source/docs/reviews-for-laravel/installation
language: en
---

[All packages](https://roundly-consulting.com/open-source.md)

[Reviews for Laravel](https://roundly-consulting.com/open-source/docs/reviews-for-laravel.md)

# Installation

Require the package. The service provider is auto-discovered and registers the global Reviews facade alias, and its two Roundly dependencies — Media Library for Laravel and Enums for Laravel — plus the package toolkit are installed automatically:

```bash
composer require roundly-consulting/reviews-for-laravel

php artisan vendor:publish --tag="reviews-migrations"
php artisan vendor:publish --tag="media-migrations"
php artisan migrate
```

## Publish-only migrations

The package loads no migrations of its own, so a bare php artisan migrate creates nothing until you have published them. reviews-migrations publishes three files: create\_reviews\_table, create\_review\_votes\_table and cascade\_review\_responses\_on\_delete, which makes owner responses cascade with their review (see Database schema). media-migrations publishes Media Library’s media table, which stores review photos.

An install that already ran create\_reviews\_table picks up the cascade by publishing reviews-migrations again and migrating — it works on MySQL, PostgreSQL and SQLite and keeps every row. The publisher never overwrites a migration whose contents differ, so it also drops a freshly stamped copy of create\_reviews\_table next to yours; that copy does nothing over the existing table, and you can delete it.

If your authors, subjects or voters use UUID or ULID keys, publish the config and set key\_type before you migrate — see Database schema.

## Optional publishing

The config file is optional — every key has a sensible, mostly env-backed default. Publish it only to override:

```bash
php artisan vendor:publish --tag="reviews-config"
```

Translations (the validation and moderation messages — English and Slovak ship, so publish them only to reword or add a language) and the JSON resources (to reshape the API output) publish separately:

```bash
# Translations → lang/vendor/reviews
php artisan vendor:publish --tag="reviews-translations"

# JSON resources → app/Http/Resources/Reviews
php artisan vendor:publish --tag="reviews-resources"
```

Cached aggregate columns are opt-in and have their own tag — publish that stub once per reviewable table (see Cached aggregates):

```bash
php artisan vendor:publish --tag="reviews-aggregate-migrations"
php artisan migrate
```

The complete set of publish tags is reviews-config, reviews-migrations, reviews-translations, reviews-resources and reviews-aggregate-migrations.

## Next steps

- Add HasReviews to the models people review and CanReview to the models that write reviews.
- Create your first review with Reviews::for($subject)->by($author).
- Decide on moderation: keep the pending queue, auto-approve, or plug in a moderator.

## Show your open-source love

This package is free and MIT-licensed. If it saves you time, a one-off donation or a Patreon membership keeps it maintained, tested and documented.

[More ways to support, including crypto](https://roundly-consulting.com/support-us.md)

By donating, you agree to our [donation terms](https://roundly-consulting.com/donation-terms.md).

[Support our open source work (opens in a new tab)](https://donate.stripe.com/dRmeVe8FX5PF1Qd9pXcEw00) [Join us on Patreon (opens in a new tab)](https://www.patreon.com/cw/roundly)

## Want this built into your product?

We integrate our packages into custom Laravel and AI builds. Tell us what you're working on and we'll reply within 48 hours.

[Get a quote in 48 hours](https://roundly-consulting.com/contact.md) [Browse all packages](https://roundly-consulting.com/open-source/docs/reviews-for-laravel.md)
