1. Go to this page and download the library: Download nyoncode/laravel-ares 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/ */
nyoncode / laravel-ares example snippets
use NyonCode\Ares\Contracts\AresClientInterface;
final class CompanyLookupService
{
public function __construct(
private readonly AresClientInterface $ares,
) {}
public function companyName(string $ic): ?string
{
return $this->ares->findCompany($ic)?->name;
}
}
final class CompanyData
{
public readonly string $ic;
public readonly string $name;
public readonly ?string $dic;
public readonly ?string $dicSkDph;
public readonly ?AddressData $registeredOffice;
public readonly ?DeliveryAddressData $deliveryAddress;
public readonly RegistrationData $registration;
public readonly array $rawData;
}
// Search by company name
$results = Ares::search('Asseco');
// Search by IC prefix
$results = Ares::search('2707', 5);
// Using the global helper
$results = ares_search('Skoda');
bash
# Index specific subjects
php artisan ares:index 27074358 25596641
# Refresh stale records (older than configured stale_days)
php artisan ares:index --refresh-stale
# Custom stale threshold and limit
php artisan ares:index --refresh-stale --stale-days=14 --limit=200
bash
# Test ARES API connectivity
php artisan ares:test 27074358
# Index subjects
php artisan ares:index 27074358
# Show indexing statistics
php artisan ares:index
# Refresh stale records
php artisan ares:index --refresh-stale
bash
composer analyse
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.