PHP code example of spyrmp / working-days

1. Go to this page and download the library: Download spyrmp/working-days library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

spyrmp / working-days example snippets


\Spyrmp\WorkingDays\WorkingDayServiceProvider::class,

'WorkingDays' => Spyrmp\WorkingDays\Facades\WorkingDays::class,

$carbon = Carbon::make('2022-01-03'); // First day of the week
$workingDays = \WorkingDays::getWorkingDays($carbon);
dd($workingDays); // Carbon[]|[]

$carbon = Carbon::make('2022-01-03'); // First day of the week
$nonWorkingDays = \WorkingDays::getNonWorkingDays($carbon);
dd($nonWorkingDays); // Carbon[]|[]

$rule= [
       "date1"=>"is_non_working_day"
       "date2"="is_working_day"
];
$inputs = $request->all();
$validation = Validator::make($inputs, $rule);

php artisan vendor:publish --provider="Spyrmp\WorkingDays\WorkingDayServiceProvider" --tag="working-days"