---
title: "Installation — Comments for Laravel | Roundly"
description: "Install via Composer, publish and run the migrations — the sibling packages’ too — upgrade from 1.0, and optionally publish config and translations."
url: https://roundly-consulting.com/open-source/docs/comments-for-laravel/installation
language: en
---

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

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

# Installation

Require the package, then publish and run its migrations. The service provider is auto-discovered — no manual registration:

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

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

Migrations are publish-only — nothing is loaded from the package, so without the publish step php artisan migrate will not create the tables. The publish copies two migrations, each stamped with the publish time: create\_comments\_table, which creates the comments, comment\_mentions and comment\_locks tables, and add\_meta\_to\_comments\_table, which adds the nullable meta column (see Comment metadata). A file you already published is recognised by its content, so republishing with --force overwrites that same file instead of adding a second copy.

If the models you comment on use UUID or ULID keys, set COMMENTS\_KEY\_TYPE before you migrate — see Configuration.

## Sibling package tables

Likes, Reports, Approvals and Media Library for Laravel are pulled in as hard dependencies and ship their own migrations. Publish and run them too, so comment likes, reports and attachments have somewhere to live:

```bash
php artisan vendor:publish --tag="likes-migrations"
php artisan vendor:publish --tag="reports-migrations"
php artisan vendor:publish --tag="approvals-migrations"
php artisan vendor:publish --tag="media-migrations"
php artisan migrate
```

## Upgrading from 1.0

1.1.0 adds one migration, for the meta column. Publish the migrations again and migrate:

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

Your published create\_comments\_table is recognised by its content and left where it is; only add\_meta\_to\_comments\_table is added, with a newer timestamp. If you edited your published copy of create\_comments\_table, the publisher no longer recognises it and adds a second copy — delete that one before you migrate. Until you migrate, everything that doesn’t use meta keeps working: a comment written without metadata never names the column.

## Upgrading to 1.2

1.2.0 adds no migration. CommentResource’s author.type is now the author’s class basename (User), never the stored actor\_type — on an app without a morph map that was the full class name (App\\Models\\User), handed to every API client. Clients that matched on the old value need updating; to render a different author shape, swap comments.resources.author — see API resources.

## Config & translations

The config file is optional — every key has a default. Publish it only to override. The messages ship in English and Slovak and load under the comments:: namespace without publishing — publish the language files only to reword them or add another language:

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

The package exposes three publish tags: comments-migrations, comments-config and comments-translations.

## Check the active setup

The package reports its active configuration to Laravel’s about command — model, approval, length and depth limits, blocklist size (a count, never the terms), authorization, auto-moderation and inline media:

```bash
php artisan about --only=comments
```

## 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/comments-for-laravel.md)
