PHP code example of diegonz / php-wake-on-lan

1. Go to this page and download the library: Download diegonz/php-wake-on-lan 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/ */

    

diegonz / php-wake-on-lan example snippets




use \Diegonz\PHPWakeOnLan\PHPWakeOnLan;

$macAddresses = [
    '00:1B:2C:1C:DF:22',
    '01:1C:2C:1C:DF:13',
];

try {
    $wol = new PHPWakeOnLan();
    print_r($wol->wake($macAddresses));
} catch (Exception $e) {
    var_dump($e->getMessage());
}



use \Diegonz\PHPWakeOnLan\Facades\PHPWakeOnLan;

$macAddresses = [
    '00:1B:2C:1C:DF:22',
    '01:1C:2C:1C:DF:13',
];

try {
    print_r(PHPWakeOnLan::wake($macAddresses));
} catch (Exception $e) {
    var_dump($e->getMessage());
}
bash
php artisan vendor:publish --provider="Diegonz\PHPWakeOnLan\PHPWakeOnLanServiceProvider" --tag="config"