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

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

codewiser/intl
==============

Internationalization Helper

v1.3.3(11mo ago)09841MITPHPPHP ^8.1

Since Nov 1Pushed 11mo ago2 watchersCompare

[ Source](https://github.com/C0deWiser/intl)[ Packagist](https://packagist.org/packages/codewiser/intl)[ RSS](/packages/codewiser-intl/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (3)Versions (10)Used By (1)

Intl helper
===========

[](#intl-helper)

Date and time localization
--------------------------

[](#date-and-time-localization)

Format date and time in an app current locale.

```
intl(now())->short();
# 12/13/52 3:30pm

intl(now())->shortDate();
# 12/13/52

intl(now())->full();
# Tuesday, April 12, 1952 AD 3:30:42pm PST

intl(now())->fullTime();
# 3:30:42pm PST

$interval = now()->toPeriod(now()->addHour());
intl($interval)->long();
# January 12, 1952 from 3:30:30pm to 4:30:30pm
```

Number formatting
-----------------

[](#number-formatting)

Format numbers in an app current locale.

```
intl(100)->currency('RUB');
# €101.00

intl(0.9)->percent();
# 90 %

intl(101)->spellout();
# one hundred one
```

Multilingual model attributes
-----------------------------

[](#multilingual-model-attributes)

Such attribute stores in a database as a json object.

```
use Illuminate\Database\Eloquent\Model;
use Codewiser\Intl\Casts\Multilingual;
use Illuminate\Support\Traits\Localizable;

/**
 * @property Multilingual $name
 */
class User extends Model
{
    use Localizable;

    protected $casts = [
        'name' => Multilingual::class
    ];
}
```

### Storing

[](#storing)

A new value will be implicitly stored in a current locale.

However, you may explicitly define locale.

```
// Set value in default locale
$user->name = 'Michael';

// Set value with explicit locale
$user->withLocale('en', fn() => $user->name = 'Michael');
$user->withLocale('es', fn() => $user->name = 'Miguel');

// Set values as array
$user->name = [
    'en' => 'Michael',
    'es' => 'Miguel',
];
```

### Reading

[](#reading)

A value will be implicitly retrieved in a current locale. It would be enough to properly apply `Accept-Language` header from a User-Agent — and user will get content in a preferred language.

If value for requested locale is empty, the first not empty value will be returned.

You may explicitly define locale.

```
// Get value in default locale
$nameInCurrentLocale = (string) $user->name;
$nameInCurrentLocale = $user->name->toString();

// Get value in given locale
$nameInEn = $user->withLocale('en', fn() => $user->name);
$nameInEs = $user->withLocale('es', fn() => $user->name);

// Get all values
$user->name->toArray();
```

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance51

Moderate activity, may be stable

Popularity16

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity57

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 ~72 days

Recently: every ~54 days

Total

9

Last Release

347d ago

PHP version history (2 changes)v1.0.0PHP ^8.0

v1.2.0PHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/ce23eaf7ae48d79d2b07efc83ff7cecb2664f428bd531b167b90169423f1453d?d=identicon)[Cellard](/maintainers/Cellard)

---

Top Contributors

[![Cellard](https://avatars.githubusercontent.com/u/1220316?v=4)](https://github.com/Cellard "Cellard (12 commits)")

---

Tags

i18nlaravelmultilingual

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[mcamara/laravel-localization

Easy localization for Laravel

3.5k9.1M112](/packages/mcamara-laravel-localization)[typicms/base

A modular multilingual CMS built with Laravel, enabling developers to manage structured content like pages, news, events, and more.

1.6k20.3k](/packages/typicms-base)[vemcogroup/laravel-translation

Translation package for Laravel to scan for localisations and up/download to poeditor

135304.0k2](/packages/vemcogroup-laravel-translation)

PHPackages © 2026

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