idoneo/humano-version-control
Composer 安装命令:
composer require idoneo/humano-version-control
包简介
Advanced version control and audit system with restoration capabilities
README 文档
README
Advanced version control and audit system with restoration capabilities for Laravel applications. Built on top of spatie/laravel-activitylog.
Features
- 🔍 Comprehensive Audit Trails: Track all changes across your models
- 🔄 Data Restoration: Restore complete records or individual fields from any version
- 👤 User Activity Tracking: View all activities by specific users
- 📊 Visual Comparisons: Side-by-side comparison of different versions
- 🛡️ Permission Control: Role-based access to restoration features
- 📈 Dashboard Analytics: Overview of system activity and statistics
- 🗂️ Model Filtering: Filter activities by model type, user, date range
- 💾 Snapshot System: Optional full snapshots for complex restoration scenarios
Installation
Requirements
This package requires the following dependencies:
- PHP 8.1 or higher
- Laravel 10.0 or higher
spatie/laravel-activitylog^4.10 - For activity loggingspatie/laravel-permission^5.10|^6.0 - For role and permission managementyajra/laravel-datatables-oracle^10.11 - For DataTables functionality
Install via Composer
You can install the package via composer:
composer require idoneo/humano-version-control
Publish Dependencies
If you haven't already installed the required dependencies, they will be installed automatically. However, you may need to configure them:
# Publish and run activity log migrations php artisan vendor:publish --provider="Spatie\Activitylog\ActivitylogServiceProvider" --tag="activitylog-migrations" # Publish and run permission migrations php artisan vendor:publish --provider="Spatie\Permission\PermissionServiceProvider" # Run all migrations php artisan migrate
Package Setup
Publish and run the package migrations:
php artisan vendor:publish --tag="humano-version-control-migrations"
php artisan migrate
Optionally, publish the config file:
php artisan vendor:publish --tag="humano-version-control-config"
Configuration
The package automatically integrates with spatie/laravel-activitylog. Configure which models should have enhanced version control in the config file:
'activity_log' => [ 'trackable_models' => [ 'App\Models\Contact', 'App\Models\Project', 'App\Models\Message', ], 'versions_to_keep' => 50, 'auto_cleanup' => true, 'cleanup_after_days' => 90, ],
Usage
Basic Setup
Make sure your models use the LogsActivity trait from spatie/laravel-activitylog:
use Spatie\Activitylog\Traits\LogsActivity; use Spatie\Activitylog\LogOptions; class Contact extends Model { use LogsActivity; public function getActivitylogOptions(): LogOptions { return LogOptions::defaults() ->logFillable() ->logOnlyDirty() ->dontSubmitEmptyLogs(); } }
Accessing the Interface
- Dashboard:
/version-control- Overview and statistics - Audit Trail:
/version-control/audit- Complete activity log - User Activity:
/version-control/users/{id}/activity- Activities by specific user - Model History:
/version-control/audit/{model}/{id}- History for specific record
Restoration
The package provides several restoration options:
- Full Record Restoration: Restore all fields from a specific version
- Selective Field Restoration: Choose which fields to restore
- Preview Mode: See exactly what will change before restoring
API Endpoints
// Get versions for a specific model instance GET /version-control/api/{model}/{id}/versions // Get activities with DataTables support GET /version-control/api/activities
Commands
# Show module status php artisan humano-version-control status # Clean up old versions php artisan humano-version-control cleanup # Show restore help php artisan humano-version-control restore
Permissions
Configure which roles can perform restorations:
'restoration' => [ 'authorized_roles' => [ 'admin', 'super-admin', ], ],
UI Features
- Responsive DataTables: Sortable, filterable activity tables
- Advanced Filtering: Filter by model, user, date range
- Real-time Updates: Optional real-time activity updates
- Visual Indicators: Clear status indicators for changes
- Bulk Operations: Select multiple fields for restoration
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The GNU Affero General Public License (AGPL). Please see License File for more information.
idoneo/humano-version-control 适用场景与选型建议
idoneo/humano-version-control 是一款 基于 Blade 开发的 Composer 扩展包,目前已累计 16 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 09 月 30 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「Audit」 「laravel」 「version-control」 「activity-log」 「restoration」 「idoneo」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 idoneo/humano-version-control 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 idoneo/humano-version-control 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 idoneo/humano-version-control 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Log adding/updating/deleting of elements
Doctrine ORM provider for the auditor audit-log library.
PB Web Media Audit Bundle for Symfony
A powerful, Laravel-first GitHub API client with auto-pagination, strong typing, and comprehensive GitHub integration for repositories, pull requests, issues, and more.
Simplest Auditable for Laravel Eloquent/Model
Audit changes of your Eloquent models in Laravel/Lumen
统计信息
- 总下载量: 16
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 23
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: AGPL-3.0
- 更新时间: 2025-09-30