PHP code example of crmleaf / compliance-calendar

1. Go to this page and download the library: Download crmleaf/compliance-calendar 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/ */

    

crmleaf / compliance-calendar example snippets


use Crmleaf\Payroll\Calculators\ComplianceCalendar;
use Crmleaf\Payroll\Money;

$result = (new ComplianceCalendar())->forFinancialYear(
    financialYear: '2025-26',
);

echo $result->explain();      // the formula with the real operands in it
echo $result->workings();     // every step, one per line, with its citation
print_r($result->toArray());  // snake_case, ready for JSON

use Crmleaf\Payroll\Calculators\ComplianceCalendar;

public function show(ComplianceCalendar $calculator)
{
    return $calculator->forFinancialYear(
        financialYear: '2025-26',
    )->toArray();
}

// config/compliance-calendar.php
'route' => ['enabled' => true, 'prefix' => 'tools'],
bash
php artisan vendor:publish --tag=compliance-calendar-config