Download the PHP package beziworld/laravel-unifi without Composer
On this page you can find all versions of the php package beziworld/laravel-unifi. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download beziworld/laravel-unifi
More information about beziworld/laravel-unifi
Files in beziworld/laravel-unifi
Package laravel-unifi
Short Description Laravel client for UniFi Network: official API and classic controller API for sites, devices, clients, hotspot guests, vouchers, Wi-Fi and events.
License MIT
Homepage https://github.com/beziworld/laravel-unifi
Informations about the package laravel-unifi
Laravel UniFi
Laravel client for the UniFi Network application by Ubiquiti: sites, devices, connected clients, hotspot guest authorization, vouchers, networks, Wi-Fi broadcasts, events and alarms, for one or many controllers.
Polska wersja dokumentacji
Features
- The official UniFi Network API (API key,
/proxy/network/integration/v1/...), locally or through the Ubiquiti cloud connector (api.ui.com) - The classic controller API (session login) for what the official API does not offer: events, alarms, blocking and reconnecting clients, WLAN passphrases, controllers older than Network 9
- UniFi OS consoles (Cloud Gateway, UDM, Cloud Key Gen2+) and self-hosted legacy controllers: login path, cookie,
CSRF token and
/proxy/networkprefix handled automatically - Multiple named controllers plus
using([...])for controllers stored in your database - Self-signed TLS per connection:
verify_ssltrue, false or a CA bundle path - Hotspot vouchers with schema validation,
forStay()for vouchers valid until a hotel check-out - Typed DTOs (
Site,Device,ConnectedClient,Voucher,Network,WifiBroadcast,Event, ...) that keep the raw payload, UTCCarbonImmutabledates - Pagination with
Pageobjects and lazy iteration over all pages, aFilterbuilder for the official filter syntax - Classic API sessions cached in Laravel's cache and renewed once on HTTP 401
- Reads retried on connection errors and HTTP 5xx, writes never retried, HTTP 429 as
RateLimitExceptionwithretryAfter() php artisan unifi:checkandphp artisan unifi:vouchers- PHP 8.3+, Laravel 12 and 13, PHPStan level 8, works with
Http::fake()
Why this package
Packagist (November 2026) lists art-of-wifi/unifi-api-client with about 449k downloads: a framework-agnostic,
curl-based client for the classic API only, which keeps cookies in the PHP session and returns stdClass or
false. Its official-API sibling art-of-wifi/unifi-network-application-api-client (Saloon based) and a few
small clients exist, but there is no Laravel package. This package adds:
- both APIs behind one Laravel facade, with config files, named connections and runtime credentials
- Laravel's HTTP client, so
Http::fake()andHttp::assertSent()work in your tests - typed exceptions instead of
falseandtrigger_error() - sessions in the Laravel cache (shared by queue workers) instead of
$_SESSION - hotel-oriented helpers: vouchers for a stay, guest lists, voucher clean-up, console voucher generation
Installation
Several controllers (for example one per hotel) go into config/unifi.php:
Usage
Guest Wi-Fi vouchers for a hotel stay
Guest authorization (hotspot)
Sites, devices and statistics
Networks and Wi-Fi broadcasts
Filters and pagination
Classic API: events, alarms, blocking, WLAN passphrase
The classic API is not officially documented by Ubiquiti; endpoints follow the long-standing community
documentation. Availability of stat/event depends on the Network version.
Controllers stored in the database
Anything else
Exceptions
All exceptions extend Beziworld\Unifi\Exceptions\UnifiException:
| Exception | When |
|---|---|
AuthenticationException |
API key or login rejected (HTTP 401/403). Logins are never repeated automatically. |
RateLimitException |
HTTP 429; retryAfter() returns the seconds from Retry-After |
ApiException |
Error response or meta.rc = error; errorCode() (e.g. api.err.InvalidPayload), httpStatus(), requestId(), payload() |
ConnectionFailed |
DNS, TCP, TLS or timeout error (after read retries) |
SiteNotFound |
No site matches UNIFI_SITE |
InvalidConfiguration |
Unknown connection, missing URL or credentials, missing API key for the official API |
Notes
- Create a dedicated local account for the classic API and a dedicated API key for the official API.
- UniFi OS blocks clients after repeated failed logins; this package never retries a rejected login.
- Disabling TLS verification exposes credentials to anyone on the network path. Prefer a CA bundle path.
- Calls are synchronous; voucher batches and device actions belong in queued jobs.
Development
Author
Created and maintained by Kamil Ćwiertnia, beziworld.eu.
- E-mail: [email protected]
- Issues and feature requests: GitHub issues
- Security vulnerabilities: see SECURITY.md
Need an integration? Get in touch through beziworld.eu.
Other packages by the author
- beziworld/laravel-previo: Previo hotel PMS
- beziworld/laravel-directadmin: DirectAdmin hosting panel
- beziworld/laravel-proxmox: Proxmox VE
License
MIT. See LICENSE.md. This package is not affiliated with, endorsed by or sponsored by Ubiquiti Inc. UniFi is a trademark of Ubiquiti Inc.
All versions of laravel-unifi with dependencies
ext-json Version *
guzzlehttp/guzzle Version ^7.8
illuminate/cache Version ^12.0|^13.0
illuminate/collections Version ^12.0|^13.0
illuminate/console Version ^12.0|^13.0
illuminate/contracts Version ^12.0|^13.0
illuminate/http Version ^12.0|^13.0
illuminate/support Version ^12.0|^13.0