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(7mo ago)20MITPHPPHP ^8.2

Since Jan 12Pushed 7mo 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 1w ago

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

32

—

LowBetter than 69% of packages

Maintenance64

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

218d 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.7k16.3M154](/packages/laravel-pulse)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9922.4M146](/packages/roots-acorn)[psalm/plugin-laravel

Psalm plugin for Laravel

3345.4M354](/packages/psalm-plugin-laravel)[illuminate/notifications

The Illuminate Notifications package.

483.1M1.2k](/packages/illuminate-notifications)[flarum/core

Delightfully simple forum software.

211.5M2.5k](/packages/flarum-core)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

265.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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