layout: default title: Home nav_order: 1 permalink: / —

Laravel Postcode-My

Laravel package for Malaysian address data with postal codes from Pos Malaysia.

Get Started View on GitHub


Overview

Laravel Postcode-My provides a complete solution for managing Malaysian address data. It bundles postcode data from Pos Malaysia as a static CSV for instant seeding — no download required.

Features

Feature Description
Postcode Lookup Query locations by postcode with full address hierarchy
Static Data Bundled CSV for instant seeding, no download required
Idempotent Seeder Safe to run multiple times without duplicate data
Hierarchical Parsing State → Postcode → Post Office → Location
Custom Models Extend default models or use your own
Laravel 11/12/13 Modern PHP 8.3+

Quick Example

use Ajangsupardi\PostcodeMy\Models\Postcode;

// Find postcode with full hierarchy
$postcode = Postcode::with('state', 'locations')
    ->where('postcode', '50000')
    ->first();

Data Coverage

Requirements: PHP ^8.3 and Laravel ^11.0 / ^12.0 / ^13.0

Level Count Description
States 16 All Malaysian states & territories
Postcodes 2,862 Postcode areas with post offices
Locations 63,354 Specific locations/streets

Data sourced from Pos Malaysia API and bundled as static CSV.