2017 © Pedro Peláez
 

library laravel-workdays

Simple operations with working days for Laravel.

image

msbytes/laravel-workdays

Simple operations with working days for Laravel.

  • Tuesday, March 27, 2018
  • by msbytes
  • Repository
  • 0 Watchers
  • 0 Stars
  • 8 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 14 % Grown

The README.md

Simple working days operations for Laravel

Version Compatibility

Laravel Workdays
4.x.x 4.x.x

Installation

To install through composer, simply put the following in your composer.json file:, (*1)

{
    "require-dev": {
        "msbytes/laravel-workdays": "^4.0"
    }
}

And then run composer install from the terminal., (*2)

Quick Installation

Above installation can also be simplified by using the following command:, (*3)

composer require --dev "msbytes/laravel-workdays=^4.0"

Usage

To use this package you need to prepare HolidayProvider for your country. It must implement Msbytes\LaravelWorkdays\Contracts\HolidayProvider. There is PlHolidayProvider for Poland as an example., (*4)

Add workdays service provider to app/config/app.php., (*5)

return array(
    ...
    'providers' => array(
        ...
        'Msbytes\LaravelWorkdays\LaravelWorkdaysServiceProvider'
    ),
    ...
);

Easiest way is to just use provided Workdays facade., (*6)

Before making any operation or if you want to change country you need to set holiday provider for service., (*7)

$provider = new YourHolidayProvider();
Workdays::setHolidayProvider($provider);

Start using it (these examples are using holidays provider for Poland), (*8)

$check = Workdays::isWorkingDay('2018-03-27'); // true
$deliveryDate = Workdays::addWorkingDays('2018-03-27', 4); // 2018-04-03
$pastOrders = Workdays::substractWorkingDays('2018-03-27', 7); // 2018-03-16

License

MIT License, (*9)

The Versions

27/03 2018

4.0.3

4.0.3.0

Simple operations with working days for Laravel.

  Sources   Download

MIT

The Requires

 

by Marcin Szlęk

27/03 2018

dev-master

9999999-dev

Simple operations with working days for Laravel.

  Sources   Download

MIT

The Requires

 

by Marcin Szlęk

27/03 2018

dev-develop

dev-develop

Simple operations with working days for Laravel.

  Sources   Download

MIT

The Requires

 

by Marcin Szlęk

27/03 2018

4.0.2

4.0.2.0

Simple operations with working days for Laravel.

  Sources   Download

MIT

The Requires

 

by Marcin Szlęk

27/03 2018

4.0.1

4.0.1.0

Simple operations with working days for Laravel.

  Sources   Download

MIT

The Requires

 

by Marcin Szlęk

27/03 2018

4.0.0

4.0.0.0

Simple operations with working days for Laravel.

  Sources   Download

MIT

The Requires

 

by Marcin Szlęk