---
title: "Installation — Money for Laravel | Roundly"
description: "Install via Composer, publish the config, the exchange-rates migration and the validation messages only when you need them."
url: https://roundly-consulting.com/open-source/docs/money-for-laravel/installation
language: en
---

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

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

# Installation

Require the package with Composer. The service provider is auto-discovered — no manual registration:

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

If your app disables package discovery, register RoundlyConsulting\\Money\\MoneyServiceProvider yourself. Don’t skip it: other packages’ migrations call the $table->money() macro and fail without the provider.

```php
// bootstrap/providers.php — only when package discovery is disabled
return [
    App\Providers\AppServiceProvider::class,
    RoundlyConsulting\Money\MoneyServiceProvider::class,
];
```

## Publishing

The config file is optional — every key has a sensible default and the common ones are env-backed. Publish it only to override:

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

Publish and run the migration only if you use the database (or chain) exchange driver — it creates the money\_exchange\_rates table. Nothing is auto-loaded:

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

Optionally publish the validation messages (English and Slovak ship with the package):

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

- money-config — config/money.php.
- money-migrations — the create\_money\_exchange\_rates\_table migration, timestamped on publish.
- money-translations — lang/vendor/money/{en,sk}/validation.php.

## Before your first money migration

money.schema.currency\_length and money.schema.precision are read when migrations run and are fixed afterwards. Set them before running any migration that uses the money column macros — for example, raise currency\_length before you store custom codes such as USDT.

## At a glance

The package adds a Money section to Laravel’s about command — never provider credentials:

```bash
php artisan about   # the "Money" section: default currency, currency counts,
                    # formatter, exchange driver and rate schedule
```

## Static analysis

A PHPStan extension ships with the package (extension.neon, exposed through extra.phpstan.includes). With phpstan/extension-installer, PHPStan learns the money() / moneyJson() / currencyCode() Blueprint macros, the collection macros and Request::money() automatically.

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