PHP code example of juststeveking / companies-house-laravel
1. Go to this page and download the library: Download juststeveking/companies-house-laravel 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/ */
juststeveking / companies-house-laravel example snippets
use JustSteveKing\CompaniesHouse\Client;
class CompanyController extends Controler
{
public function __construct(
protected Client $service,
) {}
public function __invoke(Request $request)
{
$company = $this->service->company(
companyNumber: $request->get('company_number')
);
}
}
use JustSteveKing\CompaniesHouse\Client;
class CompanyOfficersController extends Controler
{
public function __construct(
protected Client $service,
) {}
public function __invoke(Request $request)
{
$company = $this->service->officers(
companyNumber: $request->get('company_number')
);
}
}
use JustSteveKing\CompaniesHouse\Client;
class CompanyOfficerController extends Controler
{
public function __construct(
protected Client $service,
) {}
public function __invoke(Request $request)
{
$company = $this->service->officer(
companyNumber: $request->get('company_number'),
appointmentId: $request->get('appointment_id'),
);
}
}
use JustSteveKing\CompaniesHouse\Client;
class CompanySearchController extends Controler
{
public function __construct(
protected Client $service,
) {}
public function __invoke(Request $request)
{
$results = $this->service->searchCompany(
query: $request->get('query'),
perPage: 25, //optional
startIndex: 0, //optional
);
}
}
use JustSteveKing\CompaniesHouse\Client;
class OfficersSearchController extends Controler
{
public function __construct(
protected Client $service,
) {}
public function __invoke(Request $request)
{
$results = $this->service->searchOfficers(
query: $request->get('query'),
perPage: 25, //optional
startIndex: 0, //optional
);
}
}
use JustSteveKing\CompaniesHouse\Client;
class SearchController extends Controler
{
public function __construct(
protected Client $service,
) {}
public function __invoke(Request $request)
{
$results = $this->service->search(
query: $request->get('query'),
perPage: 25, //optional
startIndex: 0, //optional
);
}
}