PHP code example of mivodev / laravel-mikrotik-api-ros6
1. Go to this page and download the library: Download mivodev/laravel-mikrotik-api-ros6 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/ */
mivodev / laravel-mikrotik-api-ros6 example snippets
use App\Models\Router;
use Mivo\LaravelMikrotikRos6\Facades\MikrotikRos6;
$router = Router::find(1);
// Establish dynamic connection from database model
$client = MikrotikRos6::connection([
'host' => $router->vpn_assigned_ip,
'username' => $router->api_username,
'password' => $router->api_password,
'port' => 8728,
]);
// Use any service manager on this specific router
$users = $client->hotspot()->getUsers();