Download the PHP package mr-wolf-gb/traccar without Composer
On this page you can find all versions of the php package mr-wolf-gb/traccar. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mr-wolf-gb/traccar
More information about mr-wolf-gb/traccar
Files in mr-wolf-gb/traccar
Package traccar
Short Description Traccar GPS server
License MIT
Homepage https://github.com/mr-wolf-gb/traccar
Informations about the package traccar
Traccar GPS server
This Laravel package serves as a seamless integration tool, empowering developers to effortlessly interact with Traccar servers through their robust API. Traccar, a powerful GPS tracking platform, becomes more accessible than ever as this package streamlines communication between your Laravel application and the Traccar server, offering a wide range of functionalities and capabilities. Whether you're retrieving real-time location data, managing devices, or leveraging advanced tracking features, this package simplifies the process, enhancing the efficiency and extensibility of your Laravel projects.
Table of Contents
- Installation
- Features and Usage
- Multi-users and servers
- Authentication
- Available resources
- Server
- Session
- User
- Group
- Device
- Geofence
- Notification
- Position
- Event
- Driver
- Report
- Command
- Order
- Permission
- Share
- Statistic
- Calendar
- Computed Attribute
- Maintenance
- Testing
- Changelog
- Contributing
- Credits
- License
:wrench: Required PHP version
| Version | Php Version |
|---|---|
| 1.1.1 | ^8.1 |
| 1.1.0 | ^8.1 |
| 1.0.0 | ^8.1 |
Installation
You can install the package via composer:
You can publish the config and migration:
Set Traccar server information in your .env file:
✨ Features and Usage
Multi-users and servers
Authentication
The package supports Traccar Basic authentication and API token authentication. By default, TRACCAR_AUTH_METHOD=auto uses TRACCAR_TOKEN as a Bearer token when it has a value. If no token is configured, requests fall back to Basic authentication with TRACCAR_USERNAME and TRACCAR_PASSWORD.
Use TRACCAR_AUTH_METHOD=basic when you want to force Basic authentication even if a token exists. Use TRACCAR_AUTH_METHOD=token when you want token authentication only.
Available resources
-
Server
Model : Server Model
-
Session
Model : Session Model
-
User
Model : User Model
-
Group
Model : Group Model
-
Device
Model : Device Model
-
Geofence
Model : Geofence Model
-
Notification
Model : Notification Model
-
Position
Model : Position Model
-
Event
Model : Event Model
-
Driver
Model : Driver Model
-
Report
Model : Report Model
-
Command
These endpoints return Command and CommandType models, or collections of those models.
-
Order
-
Permission
Use this repository when you need permission links that are not covered by convenience methods such as assignUserDevice.
-
Share
-
Statistic
-
Calendar
-
Computed Attribute
-
Maintenance
Commands
This command stores devices in the local database using the published migration.
Or
Listen to Traccar websocket with PHP
The package includes an Artisan command that connects to the Traccar websocket with a valid JSESSIONID cookie retrieved
from SessionResources::getCookies().
You can override the websocket URL when needed:
The command uses phrity/websocket, the maintained package for the
sirn-se/websocket-php websocket client.
Browser websocket access
Browsers cannot manually set the Cookie header on new WebSocket(...). The cookie must already be stored by the
browser, then the browser sends it automatically during the websocket handshake.
Use the TraccarSession middleware on the page that opens the websocket. It retrieves the current Traccar session cookie
and adds it to the HTTP response as Set-Cookie.
Then open the websocket without adding ?session=:
This works when Laravel and the Traccar websocket are on the same browser-facing site.
Example .env for plain HTTP:
Example .env for HTTPS:
External JavaScript app
If your JavaScript page is hosted on another domain, use a Traccar session token in the websocket URL. This avoids the
browser limitation that prevents JavaScript from setting the websocket Cookie header manually.
Generate a token from Laravel:
Then pass that token to your external JavaScript app and connect with ?token=:
Use ws:// for plain HTTP Traccar servers and wss:// for HTTPS. Prefer short-lived session tokens and avoid exposing
your permanent API token in browser code.
Testing
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Credits
- Mr.WOLF
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of traccar with dependencies
guzzlehttp/guzzle Version ^7.8
guzzlehttp/promises Version ^2.0
phrity/websocket Version ^3.7