PHPackages                             aifaiz/myrstates - 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. aifaiz/myrstates

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

aifaiz/myrstates
================

Laravel 5.\* Library for Malaysian states list

1.0.3(6y ago)21.4k1MITPHPPHP &gt;=7.1CI failing

Since Aug 8Pushed 6y ago1 watchersCompare

[ Source](https://github.com/aifaiz/laravel-malaysian-states)[ Packagist](https://packagist.org/packages/aifaiz/myrstates)[ Docs](https://hamizulfaiz.com)[ RSS](/packages/aifaiz-myrstates/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (1)Versions (5)Used By (0)

Laravel collection of Malaysian state list
==========================================

[](#laravel-collection-of-malaysian-state-list)

This package is useful for people who would want to create `dropdown` input or anything that requires the Malaysian States list.

Installing
----------

[](#installing)

`$ composer require aifaiz/myrstates`

How to use
----------

[](#how-to-use)

you can use it in anywhere such as `controller`. declare the `namespace` like this before the `class`

`use AiFaiz\Malaysia\MyStates;`

accessing the states:

`$states = MyStates::getStates()`

Collections of states will be returned and you can perform `collection` method on it. such as:

`$states->first()`

refer to [Collection Methods](https://laravel.com/docs/5.8/collections#available-methods) for more info on utilizing `collections`

Getting the state name by code
------------------------------

[](#getting-the-state-name-by-code)

```

$state = MyStates::stateByCode('KUL')
// Kuala Lumpur

```

Using Alias
-----------

[](#using-alias)

You can use it directly in laravel `blade template` like this:

```

    @foreach(MalayStates::getStates() as $state)
	{{$state['name']}}
	@endforeach

```

Sample Data
-----------

[](#sample-data)

[![Collections Result](img/collection-sample.png)](img/collection-sample.png)

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community8

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

Total

4

Last Release

2473d ago

### Community

Maintainers

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

---

Top Contributors

[![aifaiz](https://avatars.githubusercontent.com/u/6671949?v=4)](https://github.com/aifaiz "aifaiz (15 commits)")

---

Tags

laravel-5-packagemalaysian-statesstatesMalaysia

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/aifaiz-myrstates/health.svg)

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

###  Alternatives

[pragmarx/countries

PHP Countries and Currencies

1.9k3.3M18](/packages/pragmarx-countries)[dougsisk/laravel-country-state

Country &amp; state helper for Laravel.

1681.7M](/packages/dougsisk-laravel-country-state)[pragmarx/countries-laravel

Countries for Laravel

1471.1M2](/packages/pragmarx-countries-laravel)[dipeshsukhia/laravel-country-state-city-data

Country State City Data Provider

8230.8k](/packages/dipeshsukhia-laravel-country-state-city-data)[teknoo/states

Library to create classes following the State pattern in PHP. This can be a cleaner way for an object to change its behavior at runtime without resorting to large monolithic conditional statements and this improve maintainability and workflow writing.

1138.5k18](/packages/teknoo-states)[daveawb/understated

A PHP Finite State Machine for Laravel 5+

302.0k](/packages/daveawb-understated)

PHPackages © 2026

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