apilens/laravel-api-lens 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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 DB
  • log → stores logs in file

🧠 How It Works

  1. Middleware captures request + response
  2. Event is created
  3. Tracker sends data to transport
  4. Transport stores logs (DB/file)
  5. 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

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-03-17

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固