PHPackages                             rajtika/mongovity - 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. [Logging &amp; Monitoring](/categories/logging)
4. /
5. rajtika/mongovity

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

rajtika/mongovity
=================

Application activity log with mongodb

01551PHP

Since Oct 22Pushed 6mo ago1 watchersCompare

[ Source](https://github.com/jewel-rana/laravel-activity-mongodb)[ Packagist](https://packagist.org/packages/rajtika/mongovity)[ RSS](/packages/rajtika-mongovity/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Welcome to mongovity package
============================

[](#welcome-to-mongovity-package)

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

[](#requirements)

- jenssegers/laravel-mongodb
- php mongodb extension
- php7.4 or higher

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

[](#installation)

- composer require rajtika/mongovity
- php artisan vendor:publish --provider="Rajtika\\Mongovity\\MongovityServiceProvider"

Implementation
--------------

[](#implementation)

- set your mongodb connection and give connection name in the mongovity.php config file
- If you want to log all model activity automatically follow the instructions below

```
//Add ActivityTrait in you model which you want to log
use Rajtika\Mongovity\Contracts\ActivityTrait;

//You can define specefic events to be logged by
protected $recordEvents = [
    'created',
    'updated',
    'deleted',
    'restored'
];
/** -----------OR--------- **/
protected $loggableEvents = [
    'created',
    'updated',
    'deleted',
    'restored'
];

//If you want to save your custom activity log
use Rajtika\Mongovity\Services\Mongovity; //Use this service

    app(Mongovity::class)
    ->by(Auth::user()) //Required *
    ->on(TestModel::find(1)) // optional
    ->event('created') // optional
    ->log('Your custom message');

    /** OR **/
    use Rajtika\Mongovity\Facades\Mongovity; // use this facade
    Mongovity::by(User::first())->log("Custom message");

//If your user table has first_name and last_name you have to use this method to log the user name
public function getNameAttribute()
{
    return $this->first_name . ' ' . $this->last_name;
}

//If your user table has column other than "mobile" you need to add this method
public function getMobileAttribute()
{
    return $this->mobile_number;
}

If you want to give permission to activity log to any user, you must assing role "admin" or assign permission "activity_logs" to that user
```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance48

Moderate activity, may be stable

Popularity11

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity13

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/e9dcf443dff096d3af939a7f000435227ec4b2487a8c9a0bad221731e088f97b?d=identicon)[jewelrana.dev](/maintainers/jewelrana.dev)

---

Top Contributors

[![jewel-rana](https://avatars.githubusercontent.com/u/23020274?v=4)](https://github.com/jewel-rana "jewel-rana (37 commits)")

### Embed Badge

![Health badge](/badges/rajtika-mongovity/health.svg)

```
[![Health](https://phpackages.com/badges/rajtika-mongovity/health.svg)](https://phpackages.com/packages/rajtika-mongovity)
```

###  Alternatives

[psr/log

Common interface for logging libraries

10.4k1.2B9.1k](/packages/psr-log)[itsgoingd/clockwork

php dev tools in your browser

5.9k27.6M94](/packages/itsgoingd-clockwork)[graylog2/gelf-php

A php implementation to send log-messages to a GELF compatible backend like Graylog2.

41838.2M137](/packages/graylog2-gelf-php)[bugsnag/bugsnag-psr-logger

Official Bugsnag PHP PSR Logger.

32132.5M2](/packages/bugsnag-bugsnag-psr-logger)[consolidation/log

Improved Psr-3 / Psr\\Log logger based on Symfony Console components.

15462.2M7](/packages/consolidation-log)[datadog/php-datadogstatsd

An extremely simple PHP datadogstatsd client

19124.6M15](/packages/datadog-php-datadogstatsd)

PHPackages © 2026

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