apilens/laravel-api-lens
最新稳定版本:v0.1.8
Composer 安装命令:
composer require apilens/laravel-api-lens
包简介
API request logger and dashboard for Laravel
README 文档
README
⭐ If you find this useful, give it a star
🚀 ApiLens — Instant API Monitoring for Laravel
Stop guessing what your APIs are doing.
ApiLens gives you a real-time dashboard of your Laravel application's requests — without setting up complex tools like Datadog or NewRelic.
⚡ Why ApiLens?
- ⚡ Zero setup — install and start tracking instantly
- 🔍 See every request — endpoint, status, duration
- 🚨 Spot errors fast — 4xx / 5xx tracking
- 🐢 Detect slow APIs — performance insights
- 🧩 Built for Laravel — no external services
📸 Dashboard Preview
(Add your screenshot here:
docs/dashboard.png)
🎯 Perfect For
- Laravel developers
- Freelancers building APIs
- Startups needing quick visibility
- Debugging production issues
📊 Features
- Request logging (endpoint, method, status, time)
- Error tracking
- Top endpoints
- Slow endpoints
- Filters (status, endpoint)
- Built-in dashboard (
/apilens) - Simple token-based access control
- Database + log transport support
📦 Installation
composer require apilens/laravel-api-lens
⚙️ Setup (Recommended)
Before installing, configure your .env:
APILENS_TRANSPORT=database APILENS_TOKEN=your-secret
Then run:
php artisan apilens:install
This will:
- Run migrations
- (Optional) publish config
- Guide you to next steps
🚀 Usage
Open your browser:
http://localhost:8000/apilens?token=your-secret
🔐 Security
ApiLens uses simple token-based protection:
/apilens?token=your-secret
You can disable auth in config if needed.
⚙️ Configuration
(Optional — publish only if you want to customize)
php artisan vendor:publish --tag=apilens-config
Config file:
config/apilens.php
🗄 Database
Migrations are loaded automatically from the package.
You only need:
php artisan migrate
You do NOT need to publish migrations unless you want to modify them.
🔌 Transport Options
APILENS_TRANSPORT=database
Available:
database→ stores logs in DBlog→ stores logs in file
🧠 How It Works
- Middleware captures request + response
- Event is created
- Tracker sends data to transport
- Transport stores logs (DB/file)
- Dashboard visualizes data
🧪 Quick Test
Hit any route:
/api/test
/test
Refresh dashboard → see logs instantly
🛠 Development (Local Package)
"repositories": [ { "type": "path", "url": "../package" } ]
🚧 Roadmap
- 📈 Charts & analytics
- ⏱ Time-based filters
- 🔔 Alerts (Slack/email)
- 🌐 SaaS dashboard (multi-project)
🤝 Contributing
PRs are welcome.
📄 License
MIT
统计信息
- 总下载量: 7
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 7
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-03-17