Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Routeros Api Php

Routeros Api Php Laravel Package

evilfreelancer/routeros-api-php

A modern PHP client for the MikroTik RouterOS API. Connect to RouterOS 6 and 7 devices, run commands, and parse responses through a clean, framework-agnostic, object-oriented interface. Install via Composer and use it in Laravel or any PHP project.

View on GitHub
Deep Wiki
Context7

Mikrotik RouterOS API PHP client for your applications

Frequently asked questions about Routeros Api Php
How do I install evilfreelancer/routeros-api-php with Composer?
Install it with Composer using composer require evilfreelancer/routeros-api-php. The package is PSR-4 autoloaded and framework-agnostic, so it works in Laravel or any PHP project. You configure it with an array-based config covering host, port, username, password, TLS, and timeouts. No Laravel service provider or facade is included, so any Laravel wiring is your own.
Does this package work with Laravel, or is it framework-agnostic?
It is a framework-agnostic Composer library, not a Laravel package. There is no service provider, auto-discovery, publishable config, or facade. In Laravel you would build a small service provider and config file yourself, which is typically a one-off one to three day integration. Keep the client behind a gateway interface so it never leaks into domain code.
Which MikroTik RouterOS versions does routeros-api-php support?
The package is described as connecting to RouterOS 6 and RouterOS 7 devices through the binary API. It ships a legacy RouterOS Client and a newer query-builder client. Before adopting it, confirm the maintainers have tested the specific RouterOS builds in your fleet, such as v6.4x and v7.x. Your RouterOS version mix should drive your validation plan.
How do I connect securely to RouterOS using API-SSL on port 8729?
The library speaks the RouterOS binary API on TCP 8728 and API-SSL on 8729. Enable the TLS option in your configuration and point the client at port 8729 instead of 8728. Be aware that the library will send credentials in plaintext over 8728 and will not verify certificates unless configured. Treat TLS configuration and certificate verification as your responsibility.
Why is my RouterOS API call hanging or timing out in PHP 8.4?
The client holds a synchronous TCP socket, so a hung router can tie up a PHP-FPM worker for the duration of the round trip. Version 1.7.0 includes a PHP 8.4 stream-timeout fix, but you should validate that it covers both connect and read on the client generation you use. Set explicit connect and read timeouts, and never call the client directly on the request path. Dispatch a queued job instead.
What changed in version 1.7.0 of evilfreelancer/routeros-api-php?
Version 1.7.0 contains three targeted fixes with no API surface change. It includes a PHP 8.4 stream-timeout fix, an empty parseResponse fix for nested execute-style scripts, and a Windows compatibility change with a development dependency bump. The semver-minor bump is conservative and introduces no breaking changes or deprecations. Review the lockfile diff because the dev-dependency tree moved.
Can I use this library to run RouterOS scripts, and are empty responses handled?
Yes, the library can drive RouterOS scripting rather than only plain commands. Version 1.7.0 fixes parseResponse throwing on empty payloads for nested execute-style scripts, which was a real production failure class. You should confirm the fix has a regression test and that it distinguishes a legitimately empty response from a truncated frame. Validate your scripting paths against a test RouterOS instance before production.
How should I integrate routeros-api-php into Laravel?
Create a small RouterOsServiceProvider that binds the client as a lazily constructed singleton. Add a config/routeros.php file covering host, port, username, password, TLS toggle, connect and read timeouts, and a logging channel. Expose only narrow typed methods on your own gateway, such as provisionSubscriber, setQueue, runScript, and fetchActiveSessions. Never resolve the client in a controller; dispatch a job or service instead.
Is routeros-api-php safe for production use with MikroTik devices?
Treat it as production-capable only where MikroTik is a first-class part of your estate, such as ISP provisioning or subscriber management. The dominant risk is blocking I/O, so isolate calls in queued jobs with explicit timeouts and a health check. Version 1.7.0 contains no security fixes, so use API-SSL on 8729, enable certificate verification, and keep credentials in secrets management. Validate the PHP 8.4 timeout behavior yourself rather than assuming it.
What alternatives exist to evilfreelancer/routeros-api-php for PHP or Laravel?
Alternatives include other PHP RouterOS binary API clients and, on RouterOS 7, the built-in REST API where it fits your architecture. Compare them on RouterOS 6 and 7 support, timeout handling, TLS and certificate verification, and maintenance activity. The library is small and responsive, but it relies on a limited maintainer base, so consider a hedge if RouterOS is critical. Whichever you choose, wrap it behind your own gateway interface to keep it swappable.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
pharaonic/laravel-notification-dependencies
beautinow/translug
dev-brainiac/bot-cloaked
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
frankyso/ipaymu
3mdikram/worldmoneywords
snowsoft/config
itmosoft/laravel-subscriptions
larva/laravel-ai-qwen
adachsoft/api-version-bundle
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core