Skip to content

Latest commit

 

History

History
40 lines (28 loc) · 686 Bytes

README.md

File metadata and controls

40 lines (28 loc) · 686 Bytes

Codelocks API

Lightweight PHP wrapper for the Codelocks Netcode API version 3.

Installing

Install via composer:

composer require drinkynet/codelocks-api

Examples

Create an instance of the Codelocks class with your API key and pairing ID

$codelocks = new \drinkynet\Codelocks\Codelocks($key, $pid);

$netcode = $codelocks->netcode();

Get a netcode for lock N000001 that is valid now:

$netcode->lock('N000001')->get();

Get a netcode for lock N000000 that is valid in the future:

$code = $netcode->lock('N000000')
    ->date(new \DateTime('2016-09-23'))
    ->hour(9)
    ->duration(1)
    ->get();