apilens/laravel-api-lens

API request logger and dashboard for Laravel

Maintainers

Package info

github.com/anirbancodes69/laravel-api-lens

pkg:composer/apilens/laravel-api-lens

Statistics

Installs: 7

Dependents: 0

Suggesters: 0

Stars: 1

Open Issues: 0

v0.1.8 2026-03-18 13:41 UTC

This package is auto-updated.

Last update: 2026-04-18 13:50:37 UTC


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