PHPackages                             rdcstarr/laravel-locale - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Localization &amp; i18n](/categories/localization)
4. /
5. rdcstarr/laravel-locale

ActiveLibrary[Localization &amp; i18n](/categories/localization)

rdcstarr/laravel-locale
=======================

Database-driven language, country and translation management for Laravel.

v1.1.1(1mo ago)019↓91.7%MITPHPPHP ^8.3

Since Mar 18Pushed 2w agoCompare

[ Source](https://github.com/rdcstarr/laravel-locale)[ Packagist](https://packagist.org/packages/rdcstarr/laravel-locale)[ Docs](https://github.com/rdcstarr/laravel-locale)[ RSS](/packages/rdcstarr-laravel-locale/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (1)Dependencies (10)Versions (12)Used By (0)

laravel-locale
==============

[](#laravel-locale)

Database-driven language and country management for Laravel 13.

- **Languages** — ISO 639-1, enabled/default flags
- **Countries** — ISO 3166-1 alpha-2, flag emoji, timezone, E.164 calling code, primary language
- **Octane-safe** — stateless singleton service, current locale read dynamically per request

---

Requirements
------------

[](#requirements)

DependencyVersionPHP^8.3Laravel^13.0---

Installation
------------

[](#installation)

```
composer require rdcstarr/laravel-locale
```

Run the install command to publish and run migrations, then seed languages, countries and their relationships:

```
php artisan locale:install
```

### Manual installation

[](#manual-installation)

If you prefer to control the process yourself, publish the migrations without running the install command:

```
php artisan vendor:publish --tag=laravel-locale-migrations
```

Then run the migrations and seed the reference data:

```
php artisan migrate
php artisan db:seed --class="Rdcstarr\Locale\Database\Seeders\LanguagesSeeder"
php artisan db:seed --class="Rdcstarr\Locale\Database\Seeders\CountriesSeeder"
php artisan db:seed --class="Rdcstarr\Locale\Database\Seeders\CountryLanguageSeeder"
```

> **Note:** Migrations run automatically without publishing — skip `vendor:publish` if you do not need to modify the migration files.

---

Languages
---------

[](#languages)

```
use Locale;

// All enabled languages
Locale::enabledLanguages();

// Default language
Locale::defaultLanguage();

// Find by ISO 639-1 code
Locale::languageByCode('ro');

// code → id map (useful for seeding)
Locale::enabledLanguageCodeToId();

// Raw query builder
Locale::languages()->where('enabled', true)->get();
```

---

Countries
---------

[](#countries)

```
use Locale;

// Find by ISO 3166-1 alpha-2 code
Locale::countryByCode('RO');

// Phone prefix (ITU-T E.164, e.g. "+40")
Locale::callingCodeByCode('RO');     // → "+40"
country_calling_code('RO');          // → "+40"  (global helper)
Locale::countryByCode('RO')->calling_code;  // direct model access

// All countries sharing a calling code (e.g. NANP "+1")
Locale::countries()->byCallingCode('+1')->get();

// All countries that use a given language
Locale::countriesForLanguage('ro');

// code → id map (useful for seeding)
Locale::countryCodeToId();

// Raw query builder
Locale::countries()->with('primaryLanguage')->get();
```

---

Models
------

[](#models)

### `Language`

[](#language)

ColumnTypeNotes`id`bigint`name`stringe.g. `Romanian``code`string(5)ISO 639-1, e.g. `ro``enabled`booleandefault `true``default`booleandefault `false`### `Country`

[](#country)

ColumnTypeNotes`id`bigint`name`stringe.g. `Romania``code`string(2)ISO 3166-1 alpha-2, e.g. `RO``flag`stringURL or path`flag_emoji`stringe.g. `🇷🇴``timezone`stringe.g. `Europe/Bucharest``calling_code`string(10)ITU-T E.164, e.g. `+40`, `+1``primary_language_id`FK → languagesThe `country_language` pivot table stores all official languages per country with an `is_official` boolean.

---

Octane compatibility
--------------------

[](#octane-compatibility)

`LocaleService` is registered as a singleton but stores no request-scoped state — the current locale is always read dynamically via `app()->getLocale()`, so it is safe to reuse across requests on a long-lived worker.

---

###  Health Score

43

—

FairBetter than 90% of packages

Maintenance94

Actively maintained with recent releases

Popularity8

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~6 days

Recently: every ~15 days

Total

11

Last Release

38d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/42062586?v=4)[rdcstarr](/maintainers/rdcstarr)[@rdcstarr](https://github.com/rdcstarr)

---

Top Contributors

[![rdcstarr](https://avatars.githubusercontent.com/u/42062586?v=4)](https://github.com/rdcstarr "rdcstarr (19 commits)")

---

Tags

laraveli18nlanguagel10ntranslationoctanelocalecountrydatabase translations

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/rdcstarr-laravel-locale/health.svg)

```
[![Health](https://phpackages.com/badges/rdcstarr-laravel-locale/health.svg)](https://phpackages.com/packages/rdcstarr-laravel-locale)
```

###  Alternatives

[codezero/laravel-localized-routes

A convenient way to set up, manage and use localized routes in a Laravel app.

544656.8k4](/packages/codezero-laravel-localized-routes)[osama-98/laravel-enum-translatable

A Laravel package that provides translatable enum functionality with easy-to-use methods for working with enum values and their translations

561.1k](/packages/osama-98-laravel-enum-translatable)[jrmajor/laravel-fluent

Fluent translations for Laravel

208.8k](/packages/jrmajor-laravel-fluent)[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3913.7k](/packages/rawilk-profile-filament-plugin)[elegantly/laravel-translator

All on one translations management for Laravel

6326.3k](/packages/elegantly-laravel-translator)[opgginc/codezero-laravel-localized-routes

A convenient way to set up, manage and use localized routes in a Laravel app.

29109.8k1](/packages/opgginc-codezero-laravel-localized-routes)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
