PHP code example of php-client / keenetic

1. Go to this page and download the library: Download php-client/keenetic 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/ */

    

php-client / keenetic example snippets


use PhpClient\Keenetic\Keenetic;

$keenetic = new Keenetic(
    // Replace with real values for your router:
    baseUrl: 'http://192.168.1.1',
    login: 'admin',
    password: 'admin',
);

$keenetic->auth();

$response = $keenetic->api->devices()->listDevices();

foreach ($response->json('host') as $device) {
    echo $device['name'];
}
bash
composer