PHP code example of kz / lifx-php
1. Go to this page and download the library: Download kz/lifx-php 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/ */
kz / lifx-php example snippets
bash
$ composer
php
Kz\Lifx\LifxServiceProvider::class,
php
'Lifx' => Kz\Lifx\LifxFacade::class,
php
$api_token = 'token';
$lifx = new Kz\Lifx\Lifx($api_token);
$lifx->toggleLights();
php
// usage inside a laravel route
Route::get('/', function()
{
$lifx = Lifx::all();
return json_decode($lifx);
});