PHP code example of worksome / company-info

1. Go to this page and download the library: Download worksome/company-info 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/ */

    

worksome / company-info example snippets


use Worksome\CompanyInfo\Facades\CompanyInfo;

$companies = CompanyInfo::lookupName('worksome', 'dk');
// - or -
$companies = CompanyInfo::lookupNumber('37990485', 'dk');

[
    'number'   => '37990485',
    'name'     => 'Worksome ApS',
    'address1' => 'Toldbodgade 35, 1.',
    'address2' => '',
    'zipcode'  => '1253',
    'city'     => 'København K',
    'country'  => 'DK',
    'phone'    => '71991931',
    'email'    => '[email protected]',
]



declare(strict_types=1);

use Worksome\CompanyInfo\Facades\CompanyInfo;

it('can perform company info lookup using faked response', function () {
    $lookup = [
        'name'    => 'worksome',
        'country' => 'dk',
    ];

    $response = [[
        'number'   => '37990485',
        'name'     => 'Worksome ApS',
        'address1' => 'Toldbodgade 35, 1.',
        'address2' => '',
        'zipcode'  => '1253',
        'city'     => 'København K',
        'country'  => 'DK',
        'phone'    => '71991931',
        'email'    => '[email protected]',
    ]];

    CompanyInfo::fake($lookup, $response);

    $companies = CompanyInfo::lookupName('worksome', 'dk');

    expect($companies)->toHaveCount(1);

    expect($companies[0]->toArray())->toEqual($response[0]);
});
sh
php artisan company-info:lookup --name=worksome --country=dk
php artisan company-info:lookup --number=37990485 --country=dk