Configurations

<?php

/*
 * You can place your custom package configuration in here.
 */
return [
    /*
    |--------------------------------------------------------------------------
    | Database Configurations
    |--------------------------------------------------------------------------
    |
    */
    'table_prefix' => 'payable_',

    /*
    |--------------------------------------------------------------------------
    | Fiscal Configurations
    |--------------------------------------------------------------------------
    |
    */
    'fiscal_auto_update' => true,
    'start_date' => '7-16',
    'leap_year' => \Pratiksh\Payable\Services\IsLeapYear::class,
    'current_year' => \Pratiksh\Payable\Services\CurrentYear::class,

    /*
    |--------------------------------------------------------------------------
    | Receipt No Structure
    |--------------------------------------------------------------------------
    */
    'receipt_no' => \Pratiksh\Payable\Contracts\ReceiptNoInterface::class,

    /*
    |--------------------------------------------------------------------------
    | Default User Table
    |--------------------------------------------------------------------------
    |
    */
    'user_model' => App\Models\User::class,
    'user_table_primary_key' => 'id',
];

Leap Year

Sometimes some countries don't follow standard Carbon::now()->isLeapYear() logic. Hence we can change that by using a class-implementing IsLeapYearInterface interface.

For example, In the Nepali calendar, which is also known as the Bikram Sambat (B.S.) calendar, leap years are calculated based on a specific rule. The Nepali calendar follows a 57-year cycle, where every 57th year is a leap year. This means that in the Nepali calendar, leap years occur at regular intervals and are predictable.

Let's create a class IsNepaliNewYear

Then change leap_year the configuration in payable.php config file.

Current Year

Sometimes some countries don't follow standard Carbon::now()->year logic. Hence we can change that by using a class-implementing CurrentYearInterfaceinterface.

For example, In the Nepali calendar, which is also known as the Bikram Sambat (B.S.) calendar, 2024 AD is 2080-81 B.S

Let's create a class NepaliCurrentYear implementing CurrentYearInterface and use composer package pratiksh/nepalidate

Then change current_yearthe configuration in payable.php config file.

Receipt Number

Payable package uses default Pratiksh\Payable\Services\ReceiptNo class to return receipt no structure of payment which is as below :-

Here receipt number structure is current fiscal year and payment count added one.

We can change this strcuture by our own structure.

Let's create a class MyReceiptNo implementing ReceiptNoInterface

Then change current_yearthe configuration in payable.php config file.

Last updated