PHPackages                             afiqiqmal/esolat-malaysia - 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. [API Development](/categories/api)
4. /
5. afiqiqmal/esolat-malaysia

AbandonedArchivedProject[API Development](/categories/api)

afiqiqmal/esolat-malaysia
=========================

E-Waktu Solat in Malaysia

3.1(7y ago)10256MITPHPPHP &gt;=7.0

Since Jun 1Pushed 7y ago1 watchersCompare

[ Source](https://github.com/afiqiqmal/Esolat-Malaysia)[ Packagist](https://packagist.org/packages/afiqiqmal/esolat-malaysia)[ RSS](/packages/afiqiqmal-esolat-malaysia/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (7)Dependencies (9)Versions (9)Used By (0)

E-Solat Malaysia
================

[](#e-solat-malaysia)

[![Build Status](https://camo.githubusercontent.com/e00a6f6656866955a483e4f4dd12200dbe04c644832430a3611b314d6e6d87f3/68747470733a2f2f7472617669732d63692e6f72672f6166697169716d616c2f45736f6c61742d4d616c61797369612e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/afiqiqmal/Esolat-Malaysia)[![Coverage](https://camo.githubusercontent.com/0ce39ff3f12be9ea52a394a38566b6f52a3acc112bc1f3d0bc2531c8228b6d8a/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f6166697169716d616c2f45736f6c61742d4d616c61797369612e737667)](https://codecov.io/gh/afiqiqmal/Esolat-Malaysia)[![Packagist](https://camo.githubusercontent.com/bc5550f240abe485687684834622691be99891b2f04ec86e73cb17001a8ddf6c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6166697169716d616c2f45736f6c61742d4d616c61797369612e737667)](https://packagist.org/packages/afiqiqmal/Esolat-Malaysia)[![Packagist](https://camo.githubusercontent.com/953d27e2d525ca24a05d214c565fc291bf165169c5fb060933063eac00c86271/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6166697169716d616c2f45736f6c61742d4d616c61797369612e737667)](https://packagist.org/packages/afiqiqmal/Esolat-Malaysia)

A Packagist for Malaysia E-solat Time table. Fully Scraped from [Jakim](www.e-solat.gov.my)

Tested in PHP 7.1 Only

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

[](#installation)

#### Step 1: Install from composer

[](#step-1-install-from-composer)

```
composer require afiqiqmal/esolat-malaysia

```

Alternatively, you can specify as a dependency in your project's existing composer.json file

```
{
   "require": {
      "afiqiqmal/esolat-malaysia": "^1.0"
   }
}

```

Usage
-----

[](#usage)

After installing, you need to require Composer's autoloader and add your code.

```
require_once __DIR__ .'/../vendor/autoload.php';
```

Refer this for [Location Code](https://github.com/afiqiqmal/Esolat-Malaysia/blob/master/location_guide.md)

#### Sample

[](#sample)

```
$data = esolat()
        ->timeline()
        ->zone('PNG01')
        ->displayAs(Period::WEEK)
        ->fetch();
```

or Replace with

```
$data = (new WaktuSolat())
        ->zone('PNG01')
        ->displayAs(Period:WEEK)
        ->fetch();
```

#### Sample for Day

[](#sample-for-day)

```
$response = esolat()
        ->timeline()
        ->zone('PNG01') // P1 or PNG01
        ->displayAs(Period::DAY)
        ->setDate('2018-10-10') // if this is not set, it will automatically get current date
        ->fetch();
```

#### Sample for Today

[](#sample-for-today)

```
$response = esolat()
        ->timeline()
        ->zone('PNG01') // P1 or PNG01
        ->displayAs(Period::TODAY)
        ->fetch();
```

#### Sample for Current Week

[](#sample-for-current-week)

```
$response = esolat()
        ->timeline()
        ->zone('PNG01') // P1 or PNG01
        ->displayAs(Period::Week)
        ->setDate('2018-10-10') //if this is set, it will display the date range of startof week to end of week of the date
        ->fetch();
```

#### Sample for Month

[](#sample-for-month)

```
$data = esolat()
        ->timeline()
        ->zone('P1') // P1 or PNG01
        ->displayAs(Period::Month)
        ->month(4)
        ->fetch();
```

#### Sample for Year

[](#sample-for-year)

```
$data = esolat()
        ->timeline()
        ->zone('PNG01') // P1 or PNG01
        ->displayAs(Period::Year)
        ->fetch();
```

#### Want to search by Coordinate?

[](#want-to-search-by-coordinate)

- Just replace `zone()` with `locationProvider()`. For Example:

```
$data = esolat()
        ->timeline()
        ->locationProvider(6.6626, 100.3217, GOOGLE API KEY)
        ->displayAs(Period::Year)
        ->fetch();
```

To get Only the Address Location

```
$location = (new LocationProvider())
            ->setGoogleMapKey($key)
            ->setCoordinate($latitude, $longitude)
            ->fetch(); // Return ZoneData model

$location->getCode(); //R1
$location->getJakimCode(); //PLS01
$location->getState(); //Perlis
$location->getZone(); //Padang Besar
$location->toObject(); //return Object
$location->toArray(); //return Array
```

#### Type of Display

[](#type-of-display)

- Period::Day
- Period::Today
- Period::Week
- Period::Month
- Period::Year

#### Get Location List By State

[](#get-location-list-by-state)

```
$data = esolat()->getLocations(); //return all
$data = esolat()->getLocations('negeri sembilan');
//or
$data = Location::getLocations($state);
```

#### Get Location By Code

[](#get-location-by-code)

```
$data = esolat()->getLocationByCode('PLS01');
$data = esolat()->getLocationByCode('R1');
//or
$data = Location::getLocationByCode($code);
```

### Extra Usage

[](#extra-usage)

- `$adjustment` - By default is -2 day to fit with Malaysia Zone Date

##### Convert Date to Hijri Date

[](#convert-date-to-hijri-date)

```
$date = esolat()->date_to_hijri(\Carbon\Carbon::now(), $adjustment); // Return IslamicCarbon
$date->toDateIslamicString(); // 17-Ramadhan-1439
$date->month; // 9
$date->year; // 1439
$date->day; // 17
$date->islamic_month; // Ramadhan
```

##### Convert Hijri Date to Date

[](#convert-hijri-date-to-date)

```
$date = esolat()->hijri_to_date(17, 9, 1439, $adjustment); // Return Carbon
```

#### Get List of Nearby Mosque

[](#get-list-of-nearby-mosque)

```
$data = esolat()->getNearbyMosque(2.9474,101.8451, "GOOGLE API", "RADIUS ex: 10000");
// or
$data = (new NearbyProvider("AIzaSyA6bZ53e_RhxutbU54IMY_qBB6T9A-iGxQ"))
    ->getNearbyLocation('mosque', 2.9474,101.8451);
```

### Result

[](#result)

You should getting data similarly like SAMPLE below:

```
{
    "code": 200,
    "error": false,
    "data": {
        "bearing":"291° 2′ 45″",
        "location":{
            "state":"Perlis",
            "zone":"Padang Besar",
            "jakim_code":"PLS01",
            "code":"R2",
            "longitude":100.3217,
            "latitude":6.6626
        },
        "timeline":[
            {
                "hijri_date":"1439-9-20",
                "date":"2018-06-04",
                "day":"Monday",
                "waktu":{
                    "imsak":1528090140,
                    "subuh":1528090740,
                    "syuruk":1528095780,
                    "zohor":1528118340,
                    "asar":1528130700,
                    "maghrib":1528140780,
                    "isyak":1528145280
                }
            },
            {
                "hijri_date":"1439-9-21",
                "date":"2018-06-05",
                "day":"Tuesday",
                "waktu":{
                    "imsak":1528176540,
                    "subuh":1528177140,
                    "syuruk":1528182180,
                    "zohor":1528204740,
                    "asar":1528217100,
                    "maghrib":1528227180,
                    "isyak":1528231740
                }
            },
            {
                "hijri_date":"1439-9-22",
                "date":"2018-06-06",
                "day":"Wednesday",
                "waktu":{
                    "imsak":1528262940,
                    "subuh":1528263540,
                    "syuruk":1528268580,
                    "zohor":1528291200,
                    "asar":1528303500,
                    "maghrib":1528313580,
                    "isyak":1528318140
                }
            },
            {
                "hijri_date":"1439-9-23",
                "date":"2018-06-07",
                "day":"Thursday",
                "waktu":{
                    "imsak":1528349340,
                    "subuh":1528349940,
                    "syuruk":1528354980,
                    "zohor":1528377600,
                    "asar":1528389900,
                    "maghrib":1528399980,
                    "isyak":1528404540
                }
            },
            {
                "hijri_date":"1439-9-24",
                "date":"2018-06-08",
                "day":"Friday",
                "waktu":{
                    "imsak":1528435740,
                    "subuh":1528436340,
                    "syuruk":1528441380,
                    "zohor":1528464000,
                    "asar":1528476360,
                    "maghrib":1528486440,
                    "isyak":1528491000
                }
            },
            {
                "hijri_date":"1439-9-25",
                "date":"2018-06-09",
                "day":"Saturday",
                "waktu":{
                    "imsak":1528522200,
                    "subuh":1528522800,
                    "syuruk":1528527840,
                    "zohor":1528550400,
                    "asar":1528562760,
                    "maghrib":1528572840,
                    "isyak":1528577400
                }
            },
            {
                "hijri_date":"1439-9-26",
                "date":"2018-06-10",
                "day":"Sunday",
                "waktu":{
                    "imsak":1528608600,
                    "subuh":1528609200,
                    "syuruk":1528614240,
                    "zohor":1528636800,
                    "asar":1528649160,
                    "maghrib":1528659240,
                    "isyak":1528663800
                }
            }
        ]
    },
    "generated_at": "2018-06-02 12:58:40",
    "footer": {
        "source": "http://www.e-solat.gov.my/web/",
        "host": "JAKIM",
        "developer": {
            "name": "Hafiq",
            "homepage": "https://github.com/afiqiqmal"
        }
    }
}
```

### Result for location list

[](#result-for-location-list)

You should getting data similarly like below:

```
{
    "code": 200,
    "error": false,
    "data": [
        {
            "state": "Negeri Sembilan",
            "zone": "Jempol",
            "jakim_code": "NGS01",
            "code": "N1"
        },
        {
            "state": "Negeri Sembilan",
            "zone": "Tampin",
            "jakim_code": "NGS01",
            "code": "N2"
        },
        {
            "state": "Negeri Sembilan",
            "zone": "Port Dickson",
            "jakim_code": "NGS02",
            "code": "N3"
        },
        {
            "state": "Negeri Sembilan",
            "zone": "Seremban",
            "jakim_code": "NGS02",
            "code": "N4"
        },
        {
            "state": "Negeri Sembilan",
            "zone": "Kuala Pilah",
            "jakim_code": "NGS02",
            "code": "N5"
        },
        {
            "state": "Negeri Sembilan",
            "zone": "Jelebu",
            "jakim_code": "NGS02",
            "code": "N6"
        },
        {
            "state": "Negeri Sembilan",
            "zone": "Rembau",
            "jakim_code": "NGS02",
            "code": "N7"
        }
    ],
    "generated_at": "2018-05-31 15:35:15",
    "footer": {
        "source": "http://www.e-solat.gov.my/web/",
        "host": "JAKIM",
        "developer": {
            "name": "Hafiq",
            "homepage": "https://github.com/afiqiqmal"
        }
    }
}
```

Issue
-----

[](#issue)

- If Issue happen like the api always return empty \[\] after cross check with real site, just let me know =)

ChangeLog
---------

[](#changelog)

- See changelog.md

TODO
----

[](#todo)

- Get waktu solat by coordinate

Credit
------

[](#credit)

- Jakim
- Location Extra - Malaysia Prayer Times (mpt)

License
-------

[](#license)

Licensed under the [MIT license](http://opensource.org/licenses/MIT)

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity63

Established project with proven stability

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

Recently: every ~32 days

Total

7

Last Release

2822d ago

Major Versions

1.2 → 2.02018-06-08

2.1 → 3.02018-09-09

### Community

Maintainers

![](https://www.gravatar.com/avatar/1285084ec2d00e6c1442d03992cd156772da7267efdcbe59ac913c0676a9eb89?d=identicon)[afiqiqmal](/maintainers/afiqiqmal)

---

Top Contributors

[![afiqiqmal](https://avatars.githubusercontent.com/u/9051312?v=4)](https://github.com/afiqiqmal "afiqiqmal (44 commits)")

---

Tags

apicomposeresolatjakimmalaysiapackagistphpscrapingsolatwaktu-solat-apiwaktu-solat-jakimwaktu-solat-malaysiaphpMalaysiaprayerwaktu-solatjakim

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/afiqiqmal-esolat-malaysia/health.svg)

```
[![Health](https://phpackages.com/badges/afiqiqmal-esolat-malaysia/health.svg)](https://phpackages.com/packages/afiqiqmal-esolat-malaysia)
```

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M2.9k](/packages/craftcms-cms)[laravel/framework

The Laravel Framework.

34.8k543.8M19.5k](/packages/laravel-framework)[statamic/cms

The Statamic CMS Core Package

4.8k3.6M932](/packages/statamic-cms)[pimcore/pimcore

Content &amp; Product Management Framework (CMS/PIM/E-Commerce)

3.8k3.8M482](/packages/pimcore-pimcore)[spatie/crawler

Crawl all internal links found on a website

2.8k18.5M59](/packages/spatie-crawler)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3741.3M46](/packages/tencentcloud-tencentcloud-sdk-php)

PHPackages © 2026

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