Download the PHP package micrologs/laravel without Composer
On this page you can find all versions of the php package micrologs/laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download micrologs/laravel
More information about micrologs/laravel
Files in micrologs/laravel
Package laravel
Short Description Laravel SDK for Micrologs - self-hosted analytics and error tracking
License MIT
Homepage https://github.com/OmDongaonkar03/Micrologs
Informations about the package laravel
micrologs/laravel
Laravel SDK for Micrologs - self-hosted analytics and error tracking.
Requires Laravel 10, 11, or 12. PHP 8.1+.
How it works
Micrologs is an engine you install on your own server. You own the database, you own the data. This SDK is a first-class Laravel package - it registers a service provider, a facade, and optional middleware. HTTP calls go to your server, not to any third-party service.
Nothing goes anywhere you don't control.
Install
Auto-discovery registers the service provider and facade automatically. No manual registration needed.
Configure
Publish the config file:
Add to your .env:
MICROLOGS_HOST is the URL of the server where you installed Micrologs. MICROLOGS_KEY is your project secret key - find it when you create a project. Never use the public key here - that is for the JS snippet only.
Usage
Via facade
Via injection
Automatic error tracking
The TrackErrors middleware automatically captures unhandled exceptions and sends them to Micrologs. Register it globally so every unhandled exception is tracked without any manual try/catch.
Laravel 11+ (bootstrap/app.php):
Laravel 10 (app/Http/Kernel.php):
The middleware automatically includes the request method, URL, authenticated user ID, and IP in the error context. Severity is inferred from the exception type - Error → critical, auth exceptions → warning, validation exceptions → info, everything else → error. The exception is always re-thrown after tracking so Laravel's own error handling is unaffected.
Tracking
Track an error manually
All fields except message are optional. environment defaults to app()->environment() if not provided.
How grouping works: Micrologs hashes type + message + file + line into a fingerprint. The same error firing 1000 times creates 1 group with 1000 occurrences. If a resolved error fires again, it automatically reopens.
Track an audit event
Use dot notation for action by convention (resource.action) - it makes filtering easy.
Link management
Create a tracked short link
Get a single link
Edit a link
Delete a link
Analytics
All analytics methods return the full response array from your Micrologs server. Access data via $result['data'].
Common params
All methods accept an optional params array:
| Param | Default | Description |
|---|---|---|
range |
"30d" |
"7d" / "30d" / "90d" / "custom" |
from |
- | "YYYY-MM-DD" - required when range="custom" |
to |
- | "YYYY-MM-DD" - required when range="custom" |
Visitors
New vs returning visitors
Sessions
Pages, devices, locations, referrers, UTM
Errors
Update error status
Valid statuses: open → investigating → resolved or ignored.
Audit log
Tracked links
Custom date range
Verify a key
Error handling
The SDK never throws or crashes your application. If the Micrologs server is unreachable, returns an error, or times out - the method returns null and calls Laravel's report() function so the failure is logged to your Laravel log, not silently swallowed.
The 5 second timeout is configurable via MICROLOGS_TIMEOUT in .env.
Full method reference
| Method | Description |
|---|---|
Micrologs::error($message, $options) |
Track an error |
Micrologs::audit($action, $actor, $context) |
Track an audit event |
Micrologs::createLink($url, $label) |
Create a tracked short link |
Micrologs::getLink($code) |
Fetch a single link by code |
Micrologs::editLink($code, $options) |
Edit a link's destination, label, or active state |
Micrologs::deleteLink($code) |
Delete a link by code |
Micrologs::updateErrorStatus($ids, $status) |
Update error group status - single ID or array |
Micrologs::verify($key) |
Verify a public or secret key |
Micrologs::analytics()->visitors($params) |
Unique visitors, pageviews, sessions, bounce rate |
Micrologs::analytics()->returning($params) |
New vs returning visitors |
Micrologs::analytics()->sessions($params) |
Session duration, pages per session |
Micrologs::analytics()->pages($params) |
Top pages by pageviews |
Micrologs::analytics()->devices($params) |
Device, OS, browser breakdown |
Micrologs::analytics()->locations($params) |
Country, region, city breakdown |
Micrologs::analytics()->referrers($params) |
Traffic sources |
Micrologs::analytics()->utm($params) |
UTM campaign data |
Micrologs::analytics()->errors($params) |
Error groups with occurrence counts |
Micrologs::analytics()->errorsTrend($params) |
Daily error trend, top groups |
Micrologs::analytics()->errorDetail($params) |
Single error group - all occurrences and detail |
Micrologs::analytics()->audits($params) |
Audit log events |
Micrologs::analytics()->links($params) |
Tracked links with click counts |
Micrologs::analytics()->linkDetail($params) |
Single link - clicks over time |
Requirements
- Laravel 10, 11, or 12
- PHP 8.1+
- A running Micrologs server (v1.3.0+)
License
MIT - Om Dongaonkar
All versions of laravel with dependencies
illuminate/support Version ^10.0|^11.0|^12.0
illuminate/http Version ^10.0|^11.0|^12.0