PHPackages                             matriphe/bendera - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. matriphe/bendera

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

matriphe/bendera
================

Laravel package to convert country code (ISO 3166-1 alpha-2) to the corresponding flag emoji

0.4.1(9mo ago)0656↑150%MITPHPCI passing

Since May 4Pushed 9mo ago1 watchersCompare

[ Source](https://github.com/matriphe/bendera)[ Packagist](https://packagist.org/packages/matriphe/bendera)[ RSS](/packages/matriphe-bendera/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (6)Versions (7)Used By (0)

Bendera
=======

[](#bendera)

[![Run Tests](https://github.com/matriphe/bendera/actions/workflows/run-tests.yml/badge.svg)](https://github.com/matriphe/bendera/actions/workflows/run-tests.yml)[![Latest Stable Version](https://camo.githubusercontent.com/316e00543714cbd97ba3d7500963dc6f91103a0a2264581968fd36785170d0d7/68747470733a2f2f706f7365722e707567782e6f72672f6d617472697068652f62656e646572612f76)](//packagist.org/packages/matriphe/bendera)[![Total Downloads](https://camo.githubusercontent.com/8df7e72c469077b0ab48fed16a458d84a64dd186f7e394fb9711cc3a5cf1f45c/68747470733a2f2f706f7365722e707567782e6f72672f6d617472697068652f62656e646572612f646f776e6c6f616473)](//packagist.org/packages/matriphe/bendera)

A Laravel package to convert country code (ISO 3166-1 alpha-2) to corresponding flag emoji.

This packages wraps [Country Flags](https://github.com/stidges/country-flags) and all limitations on that package also apply to this.

> *Bendera* means flag in Indonesian 🇮🇩.

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

[](#installation)

You can install the package via composer:

### Laravel 10

[](#laravel-10)

```
composer require matriphe/bendera
```

### Laravel 9 or Older

[](#laravel-9-or-older)

```
composer require matriphe/bendera:0.3.0
```

Configuration
-------------

[](#configuration)

It is not necessary, but if you want to add mapping, publish the config file.

```
php artisan vendor:publish --provider="Matriphe\Bendera\BenderaServiceProvider" --tag="bendera"
```

For example you want to map a custom country `XY` and shows it as `ID`.

```
return [
    'aliases' => [
        'XY' => 'ID',
    ]
];
```

Usage
-----

[](#usage)

You can use the Facade `Bendera` to get the emoji.

```
Bendera::emoji('id'); // will return 🇮🇩
Bendera::emoji('en'); // will return 🇬🇧
Bendera::emoji('uk'); // will return 🇬🇧
Bendera::emoji('GB'); // will return 🇬🇧
Bendera::emoji('XYZ'); // will return null
```

For invalid country code, it will return `null`;

You can also use dependency injection style by injecting `BenderaContract` to your class.

```
class SomeAwesomeClass
{
    public function awesome(\Matriphe\Bendera\BenderaContract $bendera)
    {
        return $bendera->emoji('id');
    }
}
```

Contributing
------------

[](#contributing)

Contributions are welcome via Pull Requests on Github.

Credits
-------

[](#credits)

- [Stidges](https://github.com/stidges) for his initial Country Flags package.
- [Spatie](https://github.com/spatie) for their awesome packages.

License
-------

[](#license)

The [MIT License (MIT)](LICENSE.txt). Please see License File for more information.

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance57

Moderate activity, may be stable

Popularity18

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity46

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

Recently: every ~389 days

Total

6

Last Release

283d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/809de97d088b0eff358f96141a31bd8897216a03175448192de140f2723bdea6?d=identicon)[matriphe](/maintainers/matriphe)

---

Top Contributors

[![matriphe](https://avatars.githubusercontent.com/u/277262?v=4)](https://github.com/matriphe "matriphe (61 commits)")

---

Tags

hacktoberfestlaravelconverterflagcountryemojiISO 3166-1 alpha-2

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/matriphe-bendera/health.svg)

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

###  Alternatives

[stidges/laravel-country-flags

A Laravel wrapper for the stidges/country-flags package

28134.6k](/packages/stidges-laravel-country-flags)[spatie/laravel-livewire-wizard

Build wizards using Livewire

4061.0M4](/packages/spatie-laravel-livewire-wizard)[dougsisk/laravel-country-state

Country &amp; state helper for Laravel.

1681.7M](/packages/dougsisk-laravel-country-state)[tonysm/importmap-laravel

Use ESM with importmap to manage modern JavaScript in Laravel without transpiling or bundling.

148399.8k1](/packages/tonysm-importmap-laravel)[bezhansalleh/filament-google-analytics

Google Analytics integration for FilamentPHP

205144.8k5](/packages/bezhansalleh-filament-google-analytics)[laracraft-tech/laravel-useful-additions

A collection of useful Laravel additions!

58109.4k](/packages/laracraft-tech-laravel-useful-additions)

PHPackages © 2026

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