mecxer713 / wialon-package
Laravel and Symfony SDK for the Wialon (Gurtam) API: auto authentication, facade, simplified calls, and local SSL handling.
Requires
- php: ^8.1
- guzzlehttp/guzzle: ^7.8
- illuminate/console: ^10.0|^11.0|^12.0
- illuminate/filesystem: *
- illuminate/support: ^10.0|^11.0|^12.0
- symfony/config: ^7.4
- symfony/dependency-injection: ^7.4
- symfony/http-kernel: ^7.4
Requires (Dev)
- orchestra/testbench: ^8.0|^9.0
- phpunit/phpunit: ^10.0
This package is auto-updated.
Last update: 2026-04-05 13:51:33 UTC
README
๐ A developer-first, production-ready SDK to integrate the Wialon (Gurtam) API into Laravel & Symfony โ with zero-auth pain, zero-SSL pain, and a clean architecture youโll actually enjoy using.
๐ Table of Contents
- Wialon SDK for Laravel & Symfony
Overview
Wialon SDK for Laravel & Symfony is a modern, open-source PHP SDK designed to make Wialon API integration simple, reliable, and enjoyable.
It abstracts away the two biggest pain points developers face when working with Wialon:
- ๐ Session management (SID) โ handled automatically, transparently, and safely
- ๐ SSL & cURL certificate errors โ fixed out of the box, even on Windows
Built around a pure PHP core and wrapped with native Laravel & Symfony integrations, this package lets you focus on business logic instead of boilerplate, edge cases, and environment issues.
Whether you are building a fleet management system, an internal dashboard, or a production SaaS, this SDK is designed to scale with confidence.
โจ Key Highlights
-
๐ Zero-config authentication: automatic session (
sid) lifecycle management -
๐ง Pure PHP core: reusable, testable, framework-independent logic
-
๐งฉ Native integrations:
- Laravel Facade & Artisan command
- Symfony Bundle, DI & Console command
-
๐ Built-in SSL fixer: automatic CA certificate download (cURL 60/77)
-
๐ Developer Experience (DX) focused
๐ฆ Package Identity
-
Name:
mecxer713/wialon-package -
Type: Hybrid SDK (Laravel & Symfony)
-
Core dependencies:
guzzlehttp/guzzleilluminate/support(Laravel)symfony/http-kernel(Symfony)
-
Compatibility:
- Laravel 10, 11, 12
- Symfony 6, 7
2๏ธโฃ Laravel Integration Layer
Designed to feel 100% native to Laravel developers.
Components:
WialonServiceProviderโ container binding & config publishingFacades/Wialon.phpโ static access (Wialon::call())Commands/TestWialonConnection.phpโ Artisan diagnostic commandconfig/wialon.phpโ Laravel configuration
3๏ธโฃ Symfony Integration Layer
Delivered as a standard Symfony Bundle.
Components:
WialonBundle.phpโ bundle entry pointDependencyInjection/WialonExtension.phpโ service injectionDependencyInjection/Configuration.phpโ YAML config validationCommands/WialonCheckCommand.phpโ Console diagnostic command
๐ฅ Installation
composer require mecxer713/wialon-package
Laravel
php artisan vendor:publish --tag=wialon-config
Symfony
Enable the bundle (if not using Flex auto-discovery):
// config/bundles.php Mecxer\WialonPackage\WialonBundle::class => ['all' => true],
โ๏ธ Configuration
Environment variables
WIALON_TOKEN=your_token_here WIALON_BASE_URL=https://hst-api.wialon.com/wialon/ajax.html WIALON_DEFAULT_METHOD=POST
- Laravel:
config/wialon.php - Symfony:
config/packages/wialon.yaml
๐ Quick Usage
Laravel (Facade)
use Mecxer\WialonPackage\Facades\Wialon; Wialon::login(); $units = Wialon::getUnits();
Symfony (Dependency Injection)
use Mecxer\WialonPackage\WialonClient; public function index(WialonClient $wialon) { $units = $wialon->getUnits(); }
๐ Generic API Calls
Wialon::call('core/search_items', [ 'spec' => [ 'itemsType' => 'avl_unit', 'propName' => 'sys_name', 'propValueMask' => '*', 'sortType' => 'sys_name' ], 'force' => 1, 'flags' => 1, 'from' => 0, 'to' => 0 ]);
๐ GET vs POST
// POST (default & recommended) Wialon::callPost('core/search_items', [...]); // GET (optional) Wialon::callGet('core/get_statistics', [...]);
๐ SSL & Certificate Handling (Killer Feature)
Automatic Fix
php artisan wialon:check --download
# or
php bin/console wialon:check --download
โ Downloads a valid Mozilla CA bundle โ Fixes cURL error 60 / 77 (Windows) โ Tests API connectivity
Certificate location:
storage/certif/cacert.pem
๐งช Error Handling
try { $data = Wialon::getUnits(); } catch (\RuntimeException $e) { // Handle HTTP or API errors }
โ Tests
vendor/bin/phpunit
๐ Why This Package?
โ One SDK for Laravel & Symfony โ No SID headaches โ No SSL headaches โ Clean architecture โ Production-ready
๐ License
MIT