---
title: "Installation — Posts for Laravel | Roundly"
description: "Install via Composer, publish the posts migrations and those of the packages it builds on, then optionally the config and views."
url: https://roundly-consulting.com/open-source/docs/posts-for-laravel/installation
language: en
---

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

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

# Installation

Require the package with Composer. The service provider is auto-discovered, and the packages Posts builds on — package-toolkit, enums, sluggable, media-library, likes, reports and approvals — install as dependencies and auto-discover too:

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

Migrations are publish-only: nothing is auto-loaded, so a bare php artisan migrate creates no tables until you publish them. Choose your key types first (see Key types) — the author column and the posts ids are typed when the migration runs:

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

# The packages posts builds on are publish-only too:
php artisan vendor:publish --tag="media-migrations"
php artisan vendor:publish --tag="likes-migrations"
php artisan vendor:publish --tag="reports-migrations"
php artisan vendor:publish --tag="approvals-migrations"

# Only if you turn on slug history (posts.slugs.history):
php artisan vendor:publish --tag="sluggable-migrations"

php artisan migrate
```

## Slug indexes and locales

The posts, categories and tags migrations add one unique index per supported locale on slug. The locale list comes from sluggable-for-laravel — sluggable.locales.supported, or translatable-for-laravel’s locales when it is installed, else app.locale + app.fallback\_locale — so set it before migrating. Locales you add later get their indexes with:

```bash
php artisan sluggable:indexes "RoundlyConsulting\Posts\Models\Post"
php artisan sluggable:indexes "RoundlyConsulting\Posts\Models\Category"
php artisan sluggable:indexes "RoundlyConsulting\Posts\Models\Tag"
```

On SQL Server, which sluggable cannot index, the index step is skipped and slug uniqueness stays application-level — the install does not abort. On PostgreSQL the translatable columns ship as jsonb and the slug indexes are expression indexes on slug->>'<locale>', so slug lookups and route binding use them.

## Config and views

Both are optional. Publish the config to change defaults, and the views to restyle the rendered meta tags and JSON-LD:

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

The package’s publish tags are posts-config, posts-migrations and posts-views.

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