public function ipaddress() { $connect = new Auth(); $connect->setHost("172.18.1.254"); $connect->setUsername("admin"); $connect->setPassword("1261"); $connect->setDebug(true); $talker = new Talker($connect); $id = new Address($talker); DebugDumper::dump($id->getAll()); }
public function add() { $connect = new Auth(); $connect->setHost("172.18.1.254"); $connect->setUsername("admin"); $connect->setPassword("1261"); $connect->setDebug(true); if (Request::isMethod('get')) { $talker = new Talker($connect); $ip = new Address($talker); $data = ['ipaddr' => $ip->getAll()]; return View::make('fitur/f_filter/addfilter', $data); } else { if (Request::isMethod('post')) { $param = Input::all(); $talker = new Talker($connect); $addr = new FirewallFilter($talker); $addr->add($param); return Redirect::to('ipaddr/filter'); } } }
public function detail_Address($id) { $connect = new Auth(); $connect->setHost("172.18.1.254"); $connect->setUsername("admin"); $connect->setPassword("1261"); $connect->setDebug(true); $talker = new Talker($connect); $addr = new Address($talker); $data = ['ipaddr' => $addr->detail_address($id)]; return View::make('vaddress/detail', $data); }
<?php require '../vendor/autoload.php'; use MikrotikAPI\Talker\Talker; use MikrotikAPI\Entity\Auth; use MikrotikAPI\Commands\IP\Address; use MikrotikAPI\Commands\IP\Firewall\FirewallFilter; $auth = new Auth(); $auth->setHost("172.18.1.254"); $auth->setUsername("admin"); $auth->setPassword("1261"); $auth->setDebug(true); $talker = new Talker($auth); //$filter = new FirewallFilter($talker); //$a = $filter->getAll(); $ipaddr = new Address($talker); $listIP = $ipaddr->getAll(); MikrotikAPI\Util\DebugDumper::dump($listIP);