Download the PHP package spaanproductions/laravel-carbon-holidays without Composer

On this page you can find all versions of the php package spaanproductions/laravel-carbon-holidays. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-carbon-holidays

Carbon isHoliday() function to check if the current date is a Holiday

Latest Version on Packagist Total Downloads GitHub Actions

This package can be used to add the isHoliday() function to Carbon. This only checks the Dutch holidays at the moment. We will only check if it's a holiday, not if it's a mandatory free day.

Installation

You can install the package via composer:

It will auto discover in Laravel.

Usage

Check if any holiday

Check specific holidays

You can check for individual holidays using either English or Dutch method names:

Available Methods

All methods work with both Carbon and CarbonImmutable instances.

Holiday (English) Holiday (Dutch) English Method Dutch Method Date
New Year's Day Nieuwjaarsdag isNewYear() isNieuwjaarsdag() January 1
Good Friday Goede Vrijdag isGoodFriday() isGoedeVrijdag() Friday before Easter
Easter Sunday Paaszondag isEasterSunday() isPaaszondag() Calculated
Easter Monday Paasmaandag isEasterMonday() isPaasmaandag() Monday after Easter
King's Day Koningsdag isKingsDay() isKoningsdag() April 27*
Liberation Day Bevrijdingsdag isLiberationDay() isBevrijdingsdag() May 5
Ascension Day Hemelvaart isAscensionDay() isHemelvaart() Thursday, Easter + 39 days
Pentecost Pinksterzondag isPentecost() isPinksterzondag() Sunday, Easter + 49 days
Pentecost Monday Pinkstermaandag isPentecostMonday() isPinkstermaandag() Monday, Easter + 50 days
Christmas Day Eerste Kerstdag isChristmasDay() isEersteKerstdag() December 25
Boxing Day Tweede Kerstdag isBoxingDay() isTweedeKerstdag() December 26

* King's Day is April 26 when April 27 falls on a Sunday † Also available as isHemelvaartsdag() ‡ Aliases available: isWhitsunday() and isWhitMonday()

Practical Examples

King's Day / Koningsdag

Easter-related holidays

Working with CarbonImmutable

Configuration

Publishing the Config

You can publish the configuration file to customize which holidays are recognized:

This creates config/holidays.php in your application.

Configuration Options

Each holiday can be enabled (true) or disabled (false):

Liberation Day Special Options

Liberation Day supports three configuration modes:

Historically, Liberation Day in the Netherlands was only a public holiday once every 5 years. The 'once-every-5-years' option implements this by checking if the year is divisible by 5.

Important Notes

This allows you to:

Testing

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

Laravel Package Boilerplate

This package was generated using the Laravel Package Boilerplate.


All versions of laravel-carbon-holidays with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0|^8.1|^8.2|^8.3|^8.4|^8.5
illuminate/support Version ^10.0|^11.0|^12.0
nesbot/carbon Version ^2.0|^3.0
ext-calendar Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package spaanproductions/laravel-carbon-holidays contains the following files

Loading the files please wait ...