-
Notifications
You must be signed in to change notification settings - Fork 3
Getting Started
ZILLEALI edited this page May 20, 2026
·
1 revision
| Requirement | Version |
|---|---|
| PHP | ^8.2 |
| Laravel | ^11.0 or ^12.0 |
| RouterOS | v6.43+ or v7.x |
composer require zilleali/mikrotik-laravelPublish config:
php artisan vendor:publish --tag=mikrotik-configAdd to .env:
MIKROTIK_HOST=192.168.88.1
MIKROTIK_PORT=8728
MIKROTIK_USERNAME=admin
MIKROTIK_PASSWORD=your-password
MIKROTIK_TIMEOUT=10
# SSL (optional)
MIKROTIK_SSL=false
MIKROTIK_SSL_VERIFY=falseuse ZillEAli\MikrotikLaravel\Facades\MikroTik;
// PPPoE sessions
$sessions = MikroTik::pppoe()->getActiveSessions();
// System health
$cpu = MikroTik::system()->getCpuLoad();
$uptime = MikroTik::system()->getUptime();
// Hotspot users
$users = MikroTik::hotspot()->getUsers();
// Firewall
MikroTik::firewall()->addToAddressList('1.2.3.4', 'blocked');WinBox → IP → Services → api → Enable Port: 8728 (plain) or 8729 (SSL)
// config/mikrotik.php
'routers' => [
'main' => [
'host' => '192.168.1.1',
'username' => 'admin',
'password' => 'secret',
],
'branch' => [
'host' => '192.168.2.1',
'username' => 'admin',
'password' => 'secret',
],
],
// Usage
MikroTik::router('branch')->pppoe()->getActiveSessions();