PHP code example of joshluongo / laravel-aus

1. Go to this page and download the library: Download joshluongo/laravel-aus 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/ */

    

joshluongo / laravel-aus example snippets


// Register in your seeder file
public function configure(): OrganisationFactory|static
{
    // Inject ABN and ACN providers.
    $this->faker->addProvider(new \LuongoLabs\LaravelAus\Fakers\AbnAcnProvider($this->faker));

    return $this;
}

Validator::make($request->all(), [
    'abn' => new \LuongoLabs\LaravelAus\Rules\Abn(),
    'acn' => new \LuongoLabs\LaravelAus\Rules\Acn(),
])->validate();

use Carbon\CarbonImmutable;
use LuongoLabs\LaravelAus\Dates\FinancialYear;

$date = CarbonImmutable::parse('2026-10-17', 'Australia/Sydney');

$date->financialYear();          // FinancialYear for FY2026-27
$date->financialYear()->label(); // "FY2026-27"
$date->financialYear()->shortLabel(); // "FY27"
$date->startOfFinancialYear();   // 2026-07-01 00:00:00
$date->endOfFinancialYear();     // 2027-06-30 23:59:59.999999

FinancialYear::current('Australia/Sydney');
FinancialYear::fromDate(new DateTimeImmutable('2026-06-30'))->endYear; // 2026
(new FinancialYear(2027))->start('Australia/Sydney');                    // 2026-07-01 00:00:00
(new FinancialYear(2027))->contains($date);                              // true
bash
php artisan vendor:publish --tag="aus-translations"