PHPackages                             irfa/php-hari-libur - 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. irfa/php-hari-libur

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

irfa/php-hari-libur
===================

"Plugin ini berfungsi untuk mengecek hari libur nasional"

v1.21(4y ago)31456MITPHPPHP ^7.0

Since Mar 4Pushed 4y ago1 watchersCompare

[ Source](https://github.com/irfaardy/php-hari-libur)[ Packagist](https://packagist.org/packages/irfa/php-hari-libur)[ Docs](https://github.com/irfaardy/php-hari-libur)[ Fund](https://buymeacoff.ee/irfaardy)[ Fund](https://ko-fi.com/irfaardy)[ RSS](/packages/irfa-php-hari-libur/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)DependenciesVersions (5)Used By (0)

📅 PHP Hari Libur
================

[](#-php-hari-libur)

[![Maintainability](https://camo.githubusercontent.com/e45a4de07ef32facab721d22b4251f83a7bc0b8a69f297e4d734a2429c785d58/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f65393431373561626233356630343161373764612f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/irfaardy/php-hari-libur/maintainability) [![Scrutinizer Code Quality](https://camo.githubusercontent.com/b06bab16607fd47b25ff22827b06002daa01721182e67de983feae72f0293328/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f69726661617264792f7068702d686172692d6c696275722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/irfaardy/php-hari-libur/?branch=master) [![Support me](https://camo.githubusercontent.com/77f29148bd78dc2f56f42dc05f429e32fa7f45a323cf02468938c4032fe73292/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f537570706f72742d4275792532306d6525323061253230636f666665652d79656c6c6f772e7376673f7374796c653d666c61742d737175617265)](https://buymeacoff.ee/irfaardy) [![ko-fi](https://camo.githubusercontent.com/1fedf764fa06114b797ee53e7506df10880abed6766f854202d758df1707969d/68747470733a2f2f7777772e6b6f2d66692e636f6d2f696d672f676974687562627574746f6e5f736d2e737667)](https://ko-fi.com/S6S52P7SN)

Plugin ini berfungsi untuk mengecek hari libur nasional, untuk sekarang baru libur nasional di Indonesia.

Hari libur pada plugin ini akan selalu di update tiap tahun.

### 🛠️ Installation with Composer

[](#️-installation-with-composer-)

```
composer require irfa/php-hari-libur

```

> You can get Composer [ here](https://getcomposer.org/download/)

### Update this Package

[](#update-this-package)

```
composer update irfa/php-hari-libur

```

🛠️ Laravel Setup
-----------------

[](#️-laravel-setup-)

### Add to config/app.php

[](#add-to-configappphp)

```
'providers' => [
    ....
    Irfa\HariLibur\HariLiburServiceProvider::class,
     ];
```

### Add to config/app.php

[](#add-to-configappphp-1)

```
'aliases' => [
         ....
        'HariLibur' => Irfa\HariLibur\Facades\HariLibur::class,

    ],
```

Publish Vendor
--------------

[](#publish-vendor)

```
php artisan vendor:publish --tag=hari-libur

```

Konfigurasi untuk Laravel
-------------------------

[](#konfigurasi-untuk-laravel)

```
config/irfa/hari_libur.php
```

Konfigurasi non-Laravel
-----------------------

[](#konfigurasi-non-laravel)

```
/vendor/irfa/php-hari-libur/config/hari_libur.php

```

Jika anda menggunakan framework Laravel anda bisa mengubah atau menambah tanggal libur di `resources/data-libur-nasional/XX.json` sedangkan jika anda menggunakan PHP Native atau non-Laravel anda bisa mengubahnya di `vendor/irfa/php-hari-libur/src/Data/XX.json`

---

Usage
-----

[](#usage)

---

### Memanggil class HariLibur

[](#memanggil-class-harilibur)

### PHP Native / Non-Laravel

[](#php-native--non-laravel)

```
use Irfa\HariLibur\Func\HariLibur;

```

Jika di Laravel bisa juga menggunakan ini

```
use Irfa\HariLibur\Facades\HariLibur;
atau
use HariLibur;
```

###  Jika menggunakan PHP Native atau non-Laravel untuk contoh penggunaannya seperti ini

[](#----jika-menggunakan-php-native-atau-non-laravel-untuk-contoh-penggunaannya-seperti-ini)

```
use Irfa\HariLibur\Func\HariLibur;
....
$libur = new HariLibur();
var_dump($libur->date("17-08-2021")->isHoliday());
```

### Mengecek hari libur nasional pada tanggal yang dipilih

[](#mengecek-hari-libur-nasional-pada-tanggal-yang-dipilih)

```
HariLibur::date("17-08-2021")->isHoliday();
//return true
```

### Contoh Penggunaan

[](#contoh-penggunaan)

```
if(HariLibur::date("17-08-2021")->isHoliday())
{
    echo "Waktunya liburan.";
} else {
    echo "Waktunya bekerja.";
}
```

### Mengecek hari libur akhir pekan pada tanggal yang dipilih

[](#mengecek-hari-libur-akhir-pekan-pada-tanggal-yang-dipilih)

```
HariLibur::date("17-03-2021")->isWeekend();
//return false
```

### Contoh Penggunaan

[](#contoh-penggunaan-1)

```
if(HariLibur::date("17-08-2021")->isWeekend())
{
    echo "Selamat berakhir pekan.";
} else {
    echo "Waktunya bekerja.";
}
```

### Mengecek hari libur pada tanggal yang dipilih

[](#mengecek-hari-libur-pada-tanggal-yang-dipilih)

Fungsi ini merupakan gabungan dari fungsi diatas. Digunakan untuk mengecek tanggal merah dan akhir pekan.

```
HariLibur::date("17-08-2021")->isDayOff();
//return true
```

### Mengambil hari libur nasional sebelum dan setelahnya

[](#mengambil-hari-libur-nasional-sebelum-dan-setelahnya)

```
HariLibur::date("17-08-2021")->nextHoliday();
// mengambil data hari libur setelah tanggal 17-03-2021
HariLibur::date("17-08-2021")->prevHoliday();
// mengambil data hari libur setelah tanggal 17-03-2021
```

### Contoh Penggunaan

[](#contoh-penggunaan-2)

```
$date = HariLibur::date("17-08-2021");
//mengambil data hari libur sebelum tangal 17-08-2021
foreach ($date->nextHoliday() as $hariLibur) {
    echo "Tanggal: ".$hariLibur->date." Deskripsi: ".$hariLibur->description."";
  }
//mengambil data hari libur sesudah tangal 17-08-2021
foreach ($date->prevHoliday() as $hariLibur) {
    echo "Tanggal: ".$hariLibur->date." Deskripsi: ".$hariLibur->description."";
  }
```

### Mengambil data hari libur

[](#mengambil-data-hari-libur)

Mengambil semua data hari libur nasional sesuai regional yang diatur di konfigurasi.

```
HariLibur::get();
```

### Contoh Penggunaan

[](#contoh-penggunaan-3)

```
foreach (HariLibur::get() as $hariLibur) {
		echo "Tanggal: ".$hariLibur->date." Deskripsi: ".$hariLibur->description."";
	}
```

### Mengambil informasi libur pada tanggal yang dipilih

[](#mengambil-informasi-libur-pada-tanggal-yang-dipilih)

```
HariLibur::date("17-08-2021")->getInfo();
//return Hari Kemerdekaan Republik Indonesia
```

### Mengatur Regional secara terprogram

[](#mengatur-regional-secara-terprogram)

```
HariLibur::regional("ID")->get();
```

---

Menghapus Plugin
----------------

[](#menghapus-plugin)

---

```
composer remove irfa/php-hari-libur
```

setelah remove berhasil ada langkah tambahan jika menggunakan framework Laravel:

1. buka `config/app.php`
2. cari `providers` lalu hapus `Irfa\HariLibur\HariLiburServiceProvider::class`
3. cari `aliases` lalu hapus `'HariLibur' => Irfa\HariLibur\Facades\HariLibur::class,`
4. Simpan.

---

How to Contributing?
--------------------

[](#how-to-contributing)

1. Fork it ()
2. Commit your changes (`git commit -m 'New Feature'`)
3. Push to the branch (`git push origin your-branch`)
4. Create a new Pull Request ` your-branch -> master`

if you found bug or error, please post here  so that they can be maintained together.

---

Bagaimana cara berkontribusi?
-----------------------------

[](#bagaimana-cara-berkontribusi)

1. Lakukan fork di ()
2. Commit perubahan yang anda lakukan (`git commit -m 'Fitur Baru'`)
3. Push ke branch master (`git push origin branch-kamu`)
4. Buat Pull Request baru `branch-kamu -> master`

---

Issue
-----

[](#issue)

If you found issues or bug please create new issues here

Jika anda menemukan bug atau error silahkan posting disini  agar dapat diperbaiki bersama-sama.

---

Sumber libur nasional Indonesia :

**License**
[![GitHub license](https://camo.githubusercontent.com/f97c327cef9e63aef616e8b89d3239bfed9f7def414748d7142d502c98f19c10/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f69726661617264792f656e63727970742d66696c652d6c61726176656c3f7374796c653d666c61742d737175617265)](https://github.com/irfaardy/encrypt-file-laravel/blob/master/LICENSE)

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity51

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

Total

4

Last Release

1817d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/371ddbe81fee5daf2246e1e6cea85792b76f7042ec9232c36e84870de4b2a37b?d=identicon)[irfaardy](/maintainers/irfaardy)

---

Top Contributors

[![irfaardy](https://avatars.githubusercontent.com/u/49023326?v=4)](https://github.com/irfaardy "irfaardy (18 commits)")

---

Tags

cek-hari-liburlibur-nasionalphppluginlaravelholidayshari liburhrisplugin hari libur

### Embed Badge

![Health badge](/badges/irfa-php-hari-libur/health.svg)

```
[![Health](https://phpackages.com/badges/irfa-php-hari-libur/health.svg)](https://phpackages.com/packages/irfa-php-hari-libur)
```

###  Alternatives

[amranidev/laracombee

Recommendation system for laravel

11636.7k1](/packages/amranidev-laracombee)[tonegabes/filament-better-options

Filament form components for better radio and checkbox options.

155.2k](/packages/tonegabes-filament-better-options)[wujunze/money-wrapper

MoneyPHP Wrapper

113.8k](/packages/wujunze-money-wrapper)

PHPackages © 2026

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