abhimanyu/hive
Composer 安装命令:
composer require abhimanyu/hive
包简介
Hive is a lightweight yet powerful Laravel package designed to track and log user activities across your application. Whether it's page views, logins, form submissions, or custom events, Hive provides real-time insights into user behavior, helping you enhance analytics, improve debugging, and ensure
README 文档
README
This document provides detailed steps for installing and configuring the Laravel User Activity package, along with guidelines for setting up the package repository for Git.
1. Installation
Step 1: Install via Composer
Run the following command to install the package via Composer:
composer require abhimanyu/hive
2. Configuration
Step 2.1: Publish Configuration File
Run the following command to publish the package's configuration file:
php artisan vendor:publish --tag=config --provider="Abhimanyu\Hive\UserActivityServiceProvider"
This will create a file config/user_activity.php. Customize the configuration according to your requirements.
Step 2.2: Publish Migrations
Publish the database migration files using the command:
php artisan vendor:publish --tag=migrations --provider="Abhimanyu\Hive\UserActivityServiceProvider"
Run the migrations to create the necessary database table:
php artisan migrate
Step 2.3: Add Middleware
To enable activity tracking globally, register the middleware in app/Http/Kernel.php:
protected $middlewareGroups = [ 'web' => [ \Abhimanyu\Hive\Middleware\TrackUserActivity::class, ], ];
Step 2.4: Load Routes (Optional)
The package automatically loads its routes. To customize them, include the routes manually in your routes/web.php:
require base_path('vendor/abhimanyu/hive/src/routes/web.php');
3. Usage
Log User Activity
You can log custom user activities using the ActivityLogger service:
use Abhimanyu\Hive\Services\ActivityLogger; ActivityLogger::log(auth()->user(), 'Exported activity logs');
4. Publishing Assets
To publish the views for customization, run:
php artisan vendor:publish --tag=views --provider="Abhimanyu\Hive\UserActivityServiceProvider"
5. Git Repository Setup
Step 5.1: Initialize Git Repository
Initialize the Git repository in the package directory:
git init
Step 5.2: Create .gitignore
Add a .gitignore file in the root directory with the following content:
/vendor
/node_modules
/.env
/.idea
/.vscode
/public/storage
/storage/*.key
Step 5.3: Add All Files
Stage all files for the initial commit:
git add .
Step 5.4: Commit Changes
Create an initial commit:
git commit -m "Initial commit of Laravel User Activity package"
Step 5.5: Add Remote Repository
Add your Git remote repository:
git remote add origin <your-repository-url>
Step 5.6: Push Code
Push your code to the remote repository:
git push -u origin main
abhimanyu/hive 适用场景与选型建议
abhimanyu/hive 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 3 次下载、GitHub Stars 达 0, 最近一次更新时间为 2024 年 12 月 24 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「debugging」 「monitoring」 「laravel」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 abhimanyu/hive 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 abhimanyu/hive 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 abhimanyu/hive 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A Symfony bundle for chameleon-system/sanitycheck
A PHP package that takes a snapshot of your application and allows you to retrieve it later to help with debugging.
SoftWax Health Check Bundle for Symfony framework
1Pilot client for Symfony
Laravel Database Query Logger and debug helper.
Statsd (Object Oriented) client library for PHP
统计信息
- 总下载量: 3
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 24
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-12-24