ardigital / mikrotik
Mikrotik Router Board Api By Ardigital.ge
Installs: 2
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:package
Requires
- pear2/net_routeros: ^1.0
This package is auto-updated.
Last update: 2025-03-13 06:27:57 UTC
README
Table of Contents
Installation
composer require ardigital/mikrotik
For Laravel <= 6.x
Open config/app.php
and add MikrotikServiceProvider
to the providers
array.
'providers' => [ ArDigital\Mikrotik\MikrotikServiceProvider::class, ],
Then run:
php artisan vendor:publish --provider="ArDigital\Mikrotik\MikrotikServiceProvider"
Place Mikortik username and password configuration config/mikrotik.php
file Or .env :
MIKROTIK_IP=10.10.0.1
MIKROTIK_USERNAME=user
MIKROTIK_PASSWORD=password
Usage
Mikrotik Class
Add a class of Mikrotik to your Controller
use ArDigital\Mikrotik\Mikrotik; public function getIpList(){ $ip_list = new Mikrotik(); return $ip_list->getIps(); // return associative array } etc commands: public function firewallFilter(){ $ip_list = new Mikrotik(); return $ip_list->firewallFilter(); // return associative array } // Other methods //interfaces, firewallFilter, firewallNat, rebootSystem, dhcpClient, dhcpServer // With this method you can run an command whose method does not exist in the class // Example: public function OtherCommand(){ $mikrotik = new Mikrotik(); return $mikrotik->Command('/system/resource/print'); } //Add Configuration Example: public function AddConfig() { $mikrotik = new Mikrotik(); $configuration = $mikrotik->AddConfig('/ip address', [ 'address' => '192.168.88.12', 'interface' => 'ether4', 'comment' => 'Example Comment' ]); return $configuration; }