Download the PHP package rolle-marketplace/nager-date-laravel without Composer
On this page you can find all versions of the php package rolle-marketplace/nager-date-laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package nager-date-laravel
Nager.Date Laravel
A Laravel wrapper for the Nager.Date API that provides information about public holidays and weekend data.
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
You can install the package via composer:
The package will automatically register its service provider.
You can publish the configuration file with:
This will publish a nager-date.php file in your config directory.
Usage
Basic Usage
Available Methods
Get Available Countries
Returns a Collection of CountryDTO objects with all available countries in the API.
Get Public Holidays
Returns a Collection of PublicHolidayDTO objects with all public holidays for a specific year and country.
Get Public Holidays With Weekend
Returns a Collection of PublicHolidayDTO objects with all public holidays including weekend information.
Check if a Date is a Public Holiday
Returns a boolean indicating if a specific date is a public holiday in the given country.
Get Long Weekends
Returns a Collection of LongWeekendDTO objects with all long weekends for a specific year and country.
Get Country Info
Returns a CountryDTO object with information about a specific country.
Check if a Date is a Weekend
Returns a boolean indicating if a specific date is a weekend.
Response DTOs
All API responses are mapped to Data Transfer Objects (DTOs) for easy use:
CountryDTO
countryCode: stringname: string
PublicHolidayDTO
date: string (ISO 8601 date format)localName: stringname: stringcountryCode: stringfixed: booleanglobal: booleanlaunchYear: string|nulltypes: array
LongWeekendDTO
startDate: string (ISO 8601 date format)endDate: string (ISO 8601 date format)dayCount: integerneedBridgeDay: boolean
Testing
License
The MIT License (MIT). Please see License File for more information.
All versions of nager-date-laravel with dependencies
illuminate/support Version ^8.0|^9.0|^10.0|^11.0|^12.0
guzzlehttp/guzzle Version ^7.0