---
title: "Artisan commands — Geolocation for Laravel | Roundly"
description: "Resolve a location from the terminal to smoke-test credentials, and download or refresh the MaxMind database."
url: https://roundly-consulting.com/open-source/docs/geolocation-for-laravel/commands
language: en
---

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

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

# Artisan commands

## geolocation:locate

Resolve an IP (or, with --address, a street address) through the configured pipeline and print the Location as a field/value table, or as JSON:

```bash
php artisan geolocation:locate 8.8.8.8
php artisan geolocation:locate "1600 Amphitheatre Pkwy" --address
php artisan geolocation:locate 8.8.8.8 --json
```

The command exits non-zero when nothing resolves — handy for smoke-testing credentials and your .mmdb wiring in CI or after a deploy. Once you configure a default location, a lookup always resolves, so check the type field in the output.

## geolocation:db:update

Download or refresh the MaxMind database — a thin wrapper over Geolocation::updateDatabase(). --edition and --path override the configured edition and destination:

```bash
php artisan geolocation:db:update
php artisan geolocation:db:update --edition=GeoLite2-Country --path=/var/data/geo.mmdb
```

- Fails with a clear error when MAXMIND\_LICENSE\_KEY is missing or no destination path is configured.
- Picks the {edition}.mmdb member from the archive (or the first .mmdb it finds), writes it beside the destination file and renames it over the old one, so running lookups never read a half-written file.
- Reports download and unpacking errors (license key redacted) and exits non-zero, so a scheduled run surfaces failures; the current database stays in place.

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