---
title: "Installation — Likes for Laravel | Roundly"
description: "Install via Composer, then publish and run the likes migration — publish the config first for UUID or ULID keys or a custom table name."
url: https://roundly-consulting.com/open-source/docs/likes-for-laravel/installation
language: en
---

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

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

# Installation

Require the package, then publish and run the migration. The service provider and the Likes facade alias are auto-discovered — no manual registration:

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

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

The migration is publish-only — it is never loaded automatically. Publishing it first keeps the schema in your own database/migrations, where you can review or adjust it before it runs. Publishing again lands on the same file instead of adding a second, differently timestamped copy.

## Publish the config first when you change the schema

The migration reads likes.table and likes.key\_type when it runs. If your models use UUID or ULID keys, or you want a different table name, publish the config (or set the env vars) before you migrate:

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

# set LIKES_TABLE / LIKES_KEY_TYPE now — the migration reads them when it runs
php artisan vendor:publish --tag="likes-migrations"
php artisan migrate
```

Otherwise the config file is optional — publish it only to override defaults:

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

The only publish tags the package exposes are likes-migrations and likes-config. Once installed, php artisan about lists the configured reactions, the default reaction and whether broadcasting is on; a broken reaction setting shows as INVALID.

## Next steps

- Add HasLikes to models that can be liked and GivesLikes to models that give likes.
- Wire a like button to Likes::toggle() — or $user->toggleLike() on the model.
- Enable typed reactions in config/likes.php when you need more than a plain like.

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