PHPackages                             rolle-marketplace/nager-date-laravel - 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. rolle-marketplace/nager-date-laravel

ActiveLibrary[API Development](/categories/api)

rolle-marketplace/nager-date-laravel
====================================

Laravel wrapper for the Nager.Date API

1.0.1(1y ago)21.2k↓50%1MITPHPPHP ^7.3|^8.0CI passing

Since Feb 28Pushed 1y ago1 watchersCompare

[ Source](https://github.com/Rolle-marketplace/nager-date-laravel)[ Packagist](https://packagist.org/packages/rolle-marketplace/nager-date-laravel)[ RSS](/packages/rolle-marketplace-nager-date-laravel/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (4)Versions (3)Used By (0)

Nager.Date Laravel
==================

[](#nagerdate-laravel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/abfda7d4b5d5eed6a9a99b7b20ef43ccbcca87591d099384d911206b840849c6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f726f6c6c652d6d61726b6574706c6163652f6e616765722d646174652d6c61726176656c2e737667)](https://packagist.org/packages/rolle-marketplace/nager-date-laravel)[![GitHub Workflow Status](https://camo.githubusercontent.com/f2a7d63748c091ca260c743452b18439e6bb7dda3453083529d24c8db663aee6/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f526f6c6c652d6d61726b6574706c6163652f6e616765722d646174652d6c61726176656c2f74657374732e796d6c3f6272616e63683d6d61696e)](https://github.com/Rolle-marketplace/nager-date-laravel/actions)[![Total Downloads](https://camo.githubusercontent.com/0ae76e42f4806e5f66b6447dbdef9ae32188c3700de6c08e6f4e36a656d79a0f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f726f6c6c652d6d61726b6574706c6163652f6e616765722d646174652d6c61726176656c2e737667)](https://packagist.org/packages/rolle-marketplace/nager-date-laravel)[![License](https://camo.githubusercontent.com/103f75ac3211d94b21a76b1f366f9bab60b5b721307a770340a2d8688249b072/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f526f6c6c652d6d61726b6574706c6163652f6e616765722d646174652d6c61726176656c)](https://github.com/Rolle-marketplace/nager-date-laravel/blob/main/LICENSE.md)

A Laravel wrapper for the [Nager.Date API](https://date.nager.at/swagger/index.html) that provides information about public holidays and weekend data.

Requirements
------------

[](#requirements)

- PHP 7.3 or higher
- Laravel 8.0, 9.0, 10.0, 11.0, or 12.0
- Guzzle HTTP 7.0 or higher

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

[](#installation)

You can install the package via composer:

```
composer require rolle-marketplace/nager-date-laravel
```

The package will automatically register its service provider.

You can publish the configuration file with:

```
php artisan vendor:publish --provider="RolleMarketplace\NagerDateLaravel\NagerDateServiceProvider" --tag="config"
```

This will publish a `nager-date.php` file in your config directory.

Usage
-----

[](#usage)

### Basic Usage

[](#basic-usage)

```
// Using the facade
use RolleMarketplace\NagerDateLaravel\Facades\NagerDate;
use RolleMarketplace\NagerDateLaravel\Enums\CountryCode;

// Get all public holidays for 2023 in the United States
$holidays = NagerDate::getPublicHolidays(2023, CountryCode::US);

// Check if a specific date is a public holiday
$isHoliday = NagerDate::isPublicHoliday(CountryCode::US, 2023, 12, 25); // Christmas day

// Get all countries available in the API
$countries = NagerDate::getAvailableCountries();

// Check if a specific date is a weekend
$isWeekend = NagerDate::isWeekend(2023, 12, 23); // Saturday
```

### Available Methods

[](#available-methods)

#### Get Available Countries

[](#get-available-countries)

Returns a Collection of CountryDTO objects with all available countries in the API.

```
$countries = NagerDate::getAvailableCountries();
```

#### Get Public Holidays

[](#get-public-holidays)

Returns a Collection of PublicHolidayDTO objects with all public holidays for a specific year and country.

```
$holidays = NagerDate::getPublicHolidays(2023, CountryCode::US);
```

#### Get Public Holidays With Weekend

[](#get-public-holidays-with-weekend)

Returns a Collection of PublicHolidayDTO objects with all public holidays including weekend information.

```
$holidays = NagerDate::getPublicHolidaysWithWeekend(2023, CountryCode::US);
```

#### Check if a Date is a Public Holiday

[](#check-if-a-date-is-a-public-holiday)

Returns a boolean indicating if a specific date is a public holiday in the given country.

```
$isHoliday = NagerDate::isPublicHoliday(CountryCode::US, 2023, 12, 25);
```

#### Get Long Weekends

[](#get-long-weekends)

Returns a Collection of LongWeekendDTO objects with all long weekends for a specific year and country.

```
$longWeekends = NagerDate::getLongWeekend(2023, CountryCode::US);
```

#### Get Country Info

[](#get-country-info)

Returns a CountryDTO object with information about a specific country.

```
$countryInfo = NagerDate::getCountryInfo(CountryCode::US);
```

#### Check if a Date is a Weekend

[](#check-if-a-date-is-a-weekend)

Returns a boolean indicating if a specific date is a weekend.

```
$isWeekend = NagerDate::isWeekend(2023, 12, 23);
```

Response DTOs
-------------

[](#response-dtos)

All API responses are mapped to Data Transfer Objects (DTOs) for easy use:

### CountryDTO

[](#countrydto)

- `countryCode`: string
- `name`: string

### PublicHolidayDTO

[](#publicholidaydto)

- `date`: string (ISO 8601 date format)
- `localName`: string
- `name`: string
- `countryCode`: string
- `fixed`: boolean
- `global`: boolean
- `launchYear`: string|null
- `types`: array

### LongWeekendDTO

[](#longweekenddto)

- `startDate`: string (ISO 8601 date format)
- `endDate`: string (ISO 8601 date format)
- `dayCount`: integer
- `needBridgeDay`: boolean

Testing
-------

[](#testing)

```
composer test
```

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance44

Moderate activity, may be stable

Popularity22

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity44

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

Total

2

Last Release

444d ago

### Community

Maintainers

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

---

Top Contributors

[![rolling-babis](https://avatars.githubusercontent.com/u/179498953?v=4)](https://github.com/rolling-babis "rolling-babis (5 commits)")

---

Tags

apilaraveldateholidaysnager

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/rolle-marketplace-nager-date-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/rolle-marketplace-nager-date-laravel/health.svg)](https://phpackages.com/packages/rolle-marketplace-nager-date-laravel)
```

###  Alternatives

[smodav/mpesa

M-Pesa API implementation

16363.7k1](/packages/smodav-mpesa)[ardakilic/mutlucell

Mutlucell SMS API wrapper for sending sms text messages for Laravel

457.3k](/packages/ardakilic-mutlucell)[dariusiii/tmdb-laravel

Laravel Package for TMDB ( The Movie Database ) API. Provides easy access to the wtfzdotnet/php-tmdb-api library.

1821.1k](/packages/dariusiii-tmdb-laravel)[gufy/whmcs

WHMCS API for Laravel 5

201.7k](/packages/gufy-whmcs)

PHPackages © 2026

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