PHPackages                             sempurnama/gemilang - 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. sempurnama/gemilang

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

sempurnama/gemilang
===================

Comprehensive Malaysian data and formatting utilities for Laravel

04PHP

Since Dec 13Pushed 4mo agoCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

Gemilang 🇲🇾
===========

[](#gemilang-)

**Gemilang** is a comprehensive Laravel package for Malaysian geographical data and formatting utilities. It provides accurate lists of States, Districts (Cities/Towns), and Postcodes, sourced from community-maintained datasets, along with helpers for Malaysian specific formatting.

Features
--------

[](#features)

- **Geographical Data**:
    - **States (Negeri)**: Complete list of 13 states + 3 Federal Territories.
    - **Districts (Daerah)**: Extensive list of districts/cities mapped to states.
    - **Postcodes (Poskod)**: Over 2,900+ postcodes mapped to their respective areas.
- **Formatting Helpers**:
    - **Address**: Standardize Malaysian addresses.
    - **Phone**: Format numbers to +60 format.
    - **Currency**: RM formatting.
- **Car Brands**: List of Malaysian automotive manufacturers.

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

[](#installation)

```
composer require sempurnama/gemilang
```

Usage
-----

[](#usage)

### Locality Data

[](#locality-data)

```
use Gemilang\Facades\Gemilang;

// Get all states
$states = Gemilang::negeri();

// Get districts in a state (pass state ID/code)
$johorDistricts = Gemilang::daerah('johor');

// Get all postcodes or filter by district
$postcodes = Gemilang::poskod();
$muarPostcodes = Gemilang::poskod('johor_muar');
```

### NRIC &amp; JPN

[](#nric--jpn)

**Format NRIC**

```
echo Gemilang::formatNric('900101011234'); // 900101-01-1234
```

**Get Birth State from NRIC**

```
$state = Gemilang::getJpnState('900101011234');
echo $state['name']; // Johor
```

### Political Divisions

[](#political-divisions)

```
// Get all Parliament constituencies
$allParlimens = Gemilang::parlimens();

// Get Parliament constituencies for a specific state
$johorParlimens = Gemilang::parlimens('johor'); // Returns Collection

// Get all DUNs
$allDuns = Gemilang::duns();

// Get DUNs for a specific state
$johorDuns = Gemilang::duns('johor');
```

### Identification (State Detection)

[](#identification-state-detection)

**From NRIC**

```
$state = Gemilang::getJpnState('900101011234');
```

**From Vehicle Plate**

```
$state = Gemilang::getPlateState('W1234'); // Returns KL
$state = Gemilang::getPlateState('J1234'); // Returns Johor
```

**From Landline Phone**

```
$state = Gemilang::getPhoneState('07-1234567'); // Returns Johor (07)
```

### Locations (Aliases)

[](#locations-aliases)

```
// Standard English aliases
$states = Gemilang::states();
$districts = Gemilang::districts('johor');
$postcodes = Gemilang::postcodes();

// Search cities/districts
$tamans = Gemilang::tamans(); // Returns districts with 'Taman' in name
$kampungs = Gemilang::kampungs(); // Returns districts with 'Kampung' in name
```

### Formatting

[](#formatting)

**Phone Number**

```
echo Gemilang::formatTelefon('012-3456789'); // +60 123456789
```

**Currency**

```
echo Gemilang::formatMatawang(1250.50); // RM 1,250.50
```

**Address**

```
$address = Gemilang::formatAlamat([
    'unit' => 'No 15',
    'street' => 'Jalan Tun Razak',
    'area' => 'Kampung Baru',
    'city' => 'Kuala Lumpur',
    'postcode' => '50400',
    'state' => 'Wp Kuala Lumpur'
]);

// Output:
// No 15
// Jalan Tun Razak
// Kampung Baru
// 50400 KUALA LUMPUR
// WP KUALA LUMPUR
```

Data Sources
------------

[](#data-sources)

- **Postcodes &amp; Locations**: [AsyrafHussin/malaysia-postcodes](https://github.com/AsyrafHussin/malaysia-postcodes)
- **States Meta**: [mazfreelance/malaysia-jajahan-api](https://github.com/mazfreelance/malaysia-jajahan-api)

License
-------

[](#license)

MIT

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance53

Moderate activity, may be stable

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity12

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/7531aea01dc8605d570bf21f3496f924bb200c62deb35fc03a9e8eac583d6d9a?d=identicon)[kebalicious](/maintainers/kebalicious)

---

Top Contributors

[![kebalicious](https://avatars.githubusercontent.com/u/55217527?v=4)](https://github.com/kebalicious "kebalicious (7 commits)")

### Embed Badge

![Health badge](/badges/sempurnama-gemilang/health.svg)

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

###  Alternatives

[cjmellor/level-up

This package allows users to gain experience points (XP) and progress through levels by performing actions on your site. It can provide a simple way to track user progress and implement gamification elements into your application

66188.9k](/packages/cjmellor-level-up)[olvlvl/composer-attribute-collector

A convenient and near zero-cost way to retrieve targets of PHP 8 attributes

184108.8k8](/packages/olvlvl-composer-attribute-collector)[trafficcophp/bytebuffer

Node.js inspired byte stream buffer for PHP.

33437.2k17](/packages/trafficcophp-bytebuffer)

PHPackages © 2026

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