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.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package traccar

Traccar GPS server

Latest Version on Packagist Total Downloads Latest Unstable Version License PHP Version Require

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

: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

Model : Server Model

Model : Session Model

Model : User Model

Model : Group Model

Model : Device Model

Model : Geofence Model

Model : Notification Model

Model : Position Model

Model : Event Model

Model : Driver Model

Model : Report Model

These endpoints return Command and CommandType models, or collections of those models.

Use this repository when you need permission links that are not covered by convenience methods such as assignUserDevice.

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

License

The MIT License (MIT). Please see License File for more information.


All versions of traccar with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
guzzlehttp/guzzle Version ^7.8
guzzlehttp/promises Version ^2.0
phrity/websocket Version ^3.7
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package mr-wolf-gb/traccar contains the following files

Loading the files please wait ...