PHPackages                             rafahernandez/laravel-intl - 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. rafahernandez/laravel-intl

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

rafahernandez/laravel-intl
==========================

Easy to use internationalization functions for Laravel

3.3(5y ago)039MITPHPPHP &gt;=7.1.3

Since Sep 11Pushed 5y agoCompare

[ Source](https://github.com/rafahernandez/Laravel-Intl)[ Packagist](https://packagist.org/packages/rafahernandez/laravel-intl)[ RSS](/packages/rafahernandez-laravel-intl/feed)WikiDiscussions master Synced yesterday

READMEChangelog (3)Dependencies (9)Versions (25)Used By (0)

Laravel Intl
============

[](#laravel-intl)

[![Build Status](https://camo.githubusercontent.com/c3b8f21d6437d10a7d1db928d9813d7258a89c381aaa064f5cb16be472aabccf/68747470733a2f2f6170692e7472617669732d63692e636f6d2f726166616865726e616e64657a2f4c61726176656c2d496e746c2e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/rafahernandez/Laravel-Intl)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/24edfea26f4d2bf8306b3e5362c9e41392f803a093a1467d06eb711a917e8420/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f726166616865726e616e64657a2f4c61726176656c2d496e746c2f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/rafahernandez/Laravel-Intl/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/df3fcc2f67eee7ccece30c7e001ccdee611094d2f4095098d9c39f1dac97dd79/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f726166616865726e616e64657a2f4c61726176656c2d496e746c2f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/rafahernandez/Laravel-Intl/?branch=master)[![Latest Stable Version](https://camo.githubusercontent.com/ca08dc8af03f7aa6b18c3f37dcfb0c44ea5a122cfe061cbae38188f454e93ce6/68747470733a2f2f706f7365722e707567782e6f72672f726166616865726e616e64657a2f6c61726176656c2d696e746c2f762f737461626c65)](https://packagist.org/packages/rafahernandez/laravel-intl)[![Total Downloads](https://camo.githubusercontent.com/cdd2e3deeeb5ffcbcebde351bc8a7237bb7afc564bc7173a7e39e94fca87d52f/68747470733a2f2f706f7365722e707567782e6f72672f726166616865726e616e64657a2f6c61726176656c2d696e746c2f646f776e6c6f616473)](https://packagist.org/packages/rafahernandez/laravel-intl)[![License](https://camo.githubusercontent.com/7db645ddae2feada6c210654d2bae1762d000082bd35998d3e42a531eeead1be/68747470733a2f2f706f7365722e707567782e6f72672f726166616865726e616e64657a2f6c61726176656c2d696e746c2f6c6963656e7365)](https://packagist.org/packages/rafahernandez/laravel-intl)

> This is a fork of the archived package by Propaganistas

Easy to use internationalization functions for Laravel 5 and Lumen based on various libraries for easy retrieval of localized values and formatting of numeric values into their localized patterns.

### Overview

[](#overview)

- [Installation](#installation)
- [Usage](#usage)
    - [Country](#country)
    - [Currency](#currency)
    - [Date](#date)
    - [Language](#language)
    - [Number](#number)
- [Changing locales](#changing-locales)

### Installation

[](#installation)

Run the following command to install the latest version of the package

```
composer require rafahernandez/laravel-intl
```

#### Laravel

[](#laravel)

If you don't use auto-discovery, open up your app config and add the Service Provider to the `$providers` array:

```
'providers' => [
   ...
   rafahernandez\LaravelIntl\IntlServiceProvider::class,
],
```

#### Lumen

[](#lumen)

In `bootstrap/app.php`, register the Service Provider

```
$app->register(RafaHernandez\LaravelIntl\IntlServiceProvider::class);
```

### Usage

[](#usage)

> Note: **always** use the helper functions or Facades, or make use of dependency injection.

#### Country

[](#country)

Output localized country names.

```
use RafaHernandez\LaravelIntl\Facades\Country;

// Application locale: nl
Country::name('US'); // Verenigde Staten
Country::all(); // ['US' => 'Verenigde Staten', 'BE' => 'België', ...]
```

```
// Application locale: en
country('US'); // United States
country()->all(); // ['US' => 'United States', 'BE' => 'Belgium', ...]
```

#### Currency

[](#currency)

Output localized currency names and format currency amounts into their localized pattern.

```
use RafaHernandez\LaravelIntl\Facades\Currency;

// Application locale: nl
Currency::name('USD'); // Amerikaanse dollar
Currency::symbol('USD'); // $
Currency::format(1000, 'USD'); // $ 1.000,00
Currency::formatAccounting(-1234, 'USD'); // (US$ 1.234,00)
Currency::all(); // ['USD' => 'Amerikaanse dollar', 'EUR' => 'Euro', ...]
```

```
// Application locale: en
currency('USD'); // US Dollar
currency()->symbol('USD'); // $
currency(1000, 'USD'); // $1,000.00
currency()->all(); // ['USD' => 'US Dollar', 'EUR' => 'Euro', ...]
```

Parse localized values into native PHP numbers.

```
use RafaHernandez\LaravelIntl\Facades\Currency;

// Application locale: nl
Currency::parse('€ 1.234,50'); // 1234.5
```

```
// Application locale: nl
currency()->parse('€ 1.234,50'); // 1234.5
```

#### Date

[](#date)

Just use `Illuminate\Support\Facades\Date`.

Additional methods are also available to output localized common date formats. E.g. `toShortDateString()`:

- Locale "en": 2/18/20
- Locale "es": 18/2/20

```
$date = Carbon\Carbon::parse("2020-02-18T19:13:24+00:00");

$date->toShortDateString();  // es: "18/2/20" - en: "2/18/20"
$date->toMediumDateString(); // es: "18 feb. 2020" - en: "Feb 18, 2020"
$date->toLongDateString();   // es: "18 de febrero de 2020"  - en: "February 18, 2020"
$date->toFullDateString();   // es: "martes, 18 de febrero de 2020" - en: "Tuesday, February 18, 2020"

$date->toShortTimeString();  // es: "19:13" - en: "7:13 PM"
$date->toMediumTimeString(); // es: "19:13:24" - en: "7:13:24 PM"
$date->toLongTimeString();   // es: "19:13:24 GMT+0"  - en: "7:13:24 PM GMT+0"
$date->toFullTimeString();   // es: "19:13:24 (GMT+00:00)" - en: "7:13:24 PM GMT+00:00"

$date->toShortDatetimeString();  // es: "18/2/20 19:13" - en: "2/18/20, 7:13 PM"
$date->toMediumDatetimeString(); // es: "18 feb. 2020 19:13:24" - en: "Feb 18, 2020, 7:13:24 PM"
$date->toLongDatetimeString();   // es: "18 de febrero de 2020, 19:13:24 GMT+0" - en: "February 18, 2020 at 7:13:24 PM GMT+0"
$date->toFullDatetimeString();   // es: "martes, 18 de febrero de 2020, 19:13:24 (GMT+00:00)" - en: "Tuesday, February 18, 2020 at 7:13:24 PM GMT+00:00"
```

#### Language

[](#language)

Output localized language names.

```
use RafaHernandez\LaravelIntl\Facades\Language;

// Application locale: nl
Language::name('en'); // Engels
Language::all(); // ['en' => 'Engels', 'nl' => 'Nederlands', ...]
```

```
// Application locale: en
language('en'); // English
language()->all(); // ['en' => 'English', 'nl' => 'Dutch', ...]
```

#### Number

[](#number)

Output localized numeric values into their localized pattern.

```
use RafaHernandez\LaravelIntl\Facades\Number;

// Application locale: en
Number::format(1000); // '1,000'
Number::percent('0.75'); // '75%'
```

```
// Application locale: fr
number(1000); // '1 000'
number()->percent('0.75'); // '75 %'
```

Parse localized values into native PHP numbers.

```
use RafaHernandez\LaravelIntl\Facades\Number;

// Application locale: fr
Number::parse('1 000'); // 1000
number()->parse('1,5'); // 1.5
```

### Changing locales

[](#changing-locales)

Ever feel the need to use a locale other than the current application locale? You can temporarily use another locale by using the `usingLocale()` method.

```
country()->name('US'); // United States

country()->usingLocale('nl', function($country) {
    return $country->name('US');
}); // Verenigde Staten

country()->name('US'); // United States
```

Alternatively, you can force each component individually to the preferred locale for the remainder of the application by calling the `setLocale()` on the helper function or Facade. Usually you'd set this in the `boot()` method of a *ServiceProvider*.

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 70.2% 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 ~72 days

Recently: every ~141 days

Total

24

Last Release

1876d ago

Major Versions

1.2.5 → 2.0.02018-06-06

2.1.1 → 3.0.02019-03-09

PHP version history (3 changes)1.0.0PHP &gt;=5.5.0

2.0.0PHP &gt;=7.0

3.0.0PHP &gt;=7.1.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/75ebd6ba22e02c4f09f6865f5b7a018154ebf500e606289336f713c448d6524b?d=identicon)[Rafahernandez](/maintainers/Rafahernandez)

---

Top Contributors

[![Propaganistas](https://avatars.githubusercontent.com/u/6680176?v=4)](https://github.com/Propaganistas "Propaganistas (40 commits)")[![rafahernandez](https://avatars.githubusercontent.com/u/8619998?v=4)](https://github.com/rafahernandez "rafahernandez (13 commits)")[![duxthefux](https://avatars.githubusercontent.com/u/6758162?v=4)](https://github.com/duxthefux "duxthefux (1 commits)")[![khaledelmahdi](https://avatars.githubusercontent.com/u/9323496?v=4)](https://github.com/khaledelmahdi "khaledelmahdi (1 commits)")[![mrelevance](https://avatars.githubusercontent.com/u/5429872?v=4)](https://github.com/mrelevance "mrelevance (1 commits)")[![Muhammadnm](https://avatars.githubusercontent.com/u/130706165?v=4)](https://github.com/Muhammadnm "Muhammadnm (1 commits)")

---

Tags

laravelintlinternationalizationi18nl10n

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/rafahernandez-laravel-intl/health.svg)

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

###  Alternatives

[aura/intl

The Aura Intl package provides internationalization tools, specifically message translation.

898.3M4](/packages/aura-intl)[tigrov/yii2-country

Country data for Yii2 using Intl extension and more.

151.1k](/packages/tigrov-yii2-country)

PHPackages © 2026

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