PHPackages                             eng-mmustafa/laravel-location-monitor - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. eng-mmustafa/laravel-location-monitor

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

eng-mmustafa/laravel-location-monitor
=====================================

Laravel real-time gateway for Location Monitor Service using Redis Pub/Sub and Reverb

v1.0.0(5mo ago)20MITPHPPHP ^8.2

Since Jan 12Pushed 5mo agoCompare

[ Source](https://github.com/Eng-MMustafa/laravel-location-monitor)[ Packagist](https://packagist.org/packages/eng-mmustafa/laravel-location-monitor)[ RSS](/packages/eng-mmustafa-laravel-location-monitor/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (5)Versions (2)Used By (0)

Laravel Location Monitor
========================

[](#laravel-location-monitor)

A robust Laravel package that acts as a real-time gateway for the Location Monitor Service. It subscribes to Redis Pub/Sub events from the core engine and broadcasts them via Laravel Reverb to your frontend.

Features
--------

[](#features)

- 🔌 **Redis Pub/Sub Integration**: Listens to real-time location events from the Node.js engine.
- 📡 **Laravel Reverb Ready**: Broadcasts events securely using Laravel's native broadcasting system.
- 🛡️ **Event Driven**: Maps infrastructure messages to clean Laravel Events (`LocationUpdated`, `StatusUpdated`).
- 🏗️ **Architecturally Sound**: Decouples the heavy location processing from your Laravel application.

Requirements
------------

[](#requirements)

- PHP 8.2+
- Laravel 10.0+
- Redis
- Laravel Reverb (or any compatible broadcaster)

Installation
------------

[](#installation)

1. Install the package via composer:

```
composer require eng-mmustafa/laravel-location-monitor
```

2. Publish the configuration file:

```
php artisan vendor:publish --tag=location-monitor-config
```

3. Configure your environment variables in `.env`:

```
LOCATION_MONITOR_REDIS_CONNECTION=default
LOCATION_MONITOR_PREFIX=location-monitor:
LOCATION_MONITOR_CHANNEL=location-monitor:events
```

Usage
-----

[](#usage)

### 1. Start the Listener

[](#1-start-the-listener)

The package includes an Artisan command to listen for Redis events. This should be run as a daemon (e.g., using Supervisor).

```
php artisan location-monitor:listen
```

### 2. Subscribe in Frontend (Laravel Echo)

[](#2-subscribe-in-frontend-laravel-echo)

The package broadcasts events to private channels named `agent.{agentId}`.

```
// Using Laravel Echo
Echo.private(`agent.${agentId}`)
    .listen('.location.updated', (e) => {
        console.log('Location update:', e.location);
        console.log('Speed:', e.speed);
    })
    .listen('.status.updated', (e) => {
        console.log('Status changed:', e.newStatus);
    });
```

### 3. Access Location Data Manually

[](#3-access-location-data-manually)

You can use the Facade to access the current state of any agent from your controllers or services.

```
use LocationMonitor\Facades\LocationMonitor;

// Get last known location
$location = LocationMonitor::location($agentId);

// Get agent status
$status = LocationMonitor::status($agentId);
```

Architecture
------------

[](#architecture)

This package is designed as a **Gateway**. It does not perform location calculations or geofencing logic; that is handled by the Node.js Location Monitor Service.

1. **Node.js Service** publishes `location-monitor:events` to Redis.
2. **Laravel Listener** (`location-monitor:listen`) picks up the message.
3. **Laravel Event** (`LocationUpdated`) is dispatched.
4. **Laravel Reverb** broadcasts the event to WebSocket clients.

Security
--------

[](#security)

By default, the package defines a broadcast channel `agent.{agentId}`. You should ensure your `routes/channels.php` or `BroadcastServiceProvider` is configured to handle authentication if you need custom logic. The package registers a default callback that allows any authenticated user to listen.

License
-------

[](#license)

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

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance70

Regular maintenance activity

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

173d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/25277129?v=4)[Mohammed Mostafa](/maintainers/Eng-MMustafa)[@Eng-MMustafa](https://github.com/Eng-MMustafa)

---

Top Contributors

[![Eng-MMustafa](https://avatars.githubusercontent.com/u/25277129?v=4)](https://github.com/Eng-MMustafa "Eng-MMustafa (2 commits)")

### Embed Badge

![Health badge](/badges/eng-mmustafa-laravel-location-monitor/health.svg)

```
[![Health](https://phpackages.com/badges/eng-mmustafa-laravel-location-monitor/health.svg)](https://phpackages.com/packages/eng-mmustafa-laravel-location-monitor)
```

###  Alternatives

[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k15.1M132](/packages/laravel-pulse)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9762.4M131](/packages/roots-acorn)[flarum/core

Delightfully simple forum software.

201.4M2.3k](/packages/flarum-core)[illuminate/notifications

The Illuminate Notifications package.

513.1M1.1k](/packages/illuminate-notifications)[illuminate/broadcasting

The Illuminate Broadcasting package.

7127.2M208](/packages/illuminate-broadcasting)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
