Download the PHP package rajtika/mongovity without Composer
On this page you can find all versions of the php package rajtika/mongovity. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download rajtika/mongovity
More information about rajtika/mongovity
Files in rajtika/mongovity
Package mongovity
Short Description Application activity log with mongodb
License MIT
Informations about the package mongovity
Welcome to mongovity package
Application activity logging for Laravel using MongoDB.
Requirements
- PHP 8.4+
- Laravel 12+
- mongodb/laravel-mongodb (official MongoDB Laravel integration)
- PHP
mongodbextension (pecl install mongodb)
Upgrading from jenssegers/mongodb
This package previously depended on the abandoned jenssegers/mongodb package. It now uses the officially maintained mongodb/laravel-mongodb package.
In your Laravel application:
-
Remove the old package and install the official one:
- Update your MongoDB model imports from:
to:
-
Update
config/database.phpif needed. The service provider is auto-discovered asMongoDB\Laravel\MongoDBServiceProvider. - Upgrade this package to the latest version:
No changes are required to your mongovity usage (ActivityTrait, Mongovity service, or facade). Existing activity log data remains compatible.
Installation
Implementation
- Set your MongoDB connection and connection name in the
mongovity.phpconfig file. - If you want to log all model activity automatically, follow the instructions below.
If your user table has first_name and last_name, add this accessor to log the user name:
If your user table uses a column other than mobile, add this accessor:
To access the built-in activity log UI, assign the admin role or the activity_logs permission to the user (when using Spatie Laravel Permission).
Notes
- Activity logging requires an authenticated user (
Auth::check()). - Use Eloquent
save()/ instanceupdate()on a model. Mass updates such asModel::where()->update()do not fire model events and will not be logged.
Configuration
| Key | Description | Default |
|---|---|---|
connection_name |
MongoDB database connection | mongodb |
collection_name |
MongoDB collection for logs | activity_logs |
causer_model |
User model class for causer references | App\Models\User |
log_name |
Application log identifier | APP_NAME |
route_middleware |
Middleware for mongovity routes | ['web', 'auth'] |
index_route_middleware |
Permission middleware for the log UI | role_or_permission:admin\|activity_logs |
layout |
App layout view for embedding the log page | null (standalone page) |
content_section |
Blade section for page content | content |
styles_stack |
Blade stack for page styles | styles |
scripts_stack |
Blade stack for page scripts | scripts |
skip_daterangepicker_assets |
Skip Moment.js / DateRangePicker CDN assets | false |
Avoid jQuery / DataTables conflicts
By default, the log page renders as a standalone HTML page with its own CDN assets. That can break your application dropdowns and plugins when the page is opened inside your app.
Set your application layout in config/mongovity.php:
Your layout must already load:
- jQuery
- Bootstrap (v4 or v5)
- DataTables
- Moment.js and DateRangePicker (or leave
skip_daterangepicker_assetsasfalse)
Example in your layout:
Publish and customize the view if your stack names differ: