📚 Lorapok Documentation

Complete guide to using Lorapok Laravel Performance Monitoring Package

Installation

composer require lorapok/laravel-execution-monitor

That's it! The package automatically enables in local/dev/staging environments.

Configuration

Publish Config (Optional)

php artisan vendor:publish --tag=lorapok-config

Environment Variables

# Discord Notifications
MONITOR_DISCORD_WEBHOOK=https://discordapp.com/api/webhooks/...
MONITOR_DISCORD_ENABLED=true

# Slack Notifications
MONITOR_SLACK_WEBHOOK=https://hooks.slack.com/services/...
MONITOR_SLACK_ENABLED=true

# Email Notifications
MONITOR_MAIL_TO=admin@example.com
MONITOR_MAIL_ENABLED=true

Usage

Track Execution Time

use Lorapok\ExecutionMonitor\Facades\Monitor;

Monitor::start('expensive-operation');
// ... your code
Monitor::end('expensive-operation');

Using Closures

$result = monitor('api-call', function() {
    return Http::get('https://api.example.com/data');
});

In Controllers

use Lorapok\ExecutionMonitor\Traits\TracksExecutionTime;

class UserController extends Controller
{
    use TracksExecutionTime;

    public function index()
    {
        $this->startTimer('user-fetch');
        $users = User::paginate(20);
        $this->endTimer('user-fetch');
        
        return view('users.index', compact('users'));
    }
}

Features

Widget

A beautiful floating button appears in your application with:

Developer Tools

💻 Command Terminal

Execute artisan commands directly from the dashboard. Useful for checking migrations, clearing cache, or running monitoring audits without leaving the browser.

🎮 API Playground

A built-in REST client to test your application endpoints. Supports GET, POST, PUT, and DELETE methods with JSON body integration.

Visual Tour

Keyboard Shortcuts

Press Ctrl+Shift+C (or Cmd+Shift+C on Mac) to copy the selected query

Changelog

Stay up to date with the latest improvements. View Full Changelog

Clipboard History

All copied queries are stored in browser localStorage (max 20 entries)

Commands

# Check monitoring status
php artisan monitor:status

# Force enable
php artisan monitor:enable

# Disable monitoring
php artisan monitor:disable

# Run full performance audit
php artisan monitor:audit

# Summarize project context for AI/Devs
php artisan monitor:memory

# Generate performance heatmap
php artisan monitor:heatmap

Broadcasting

Configure Pusher for real-time alerts:

BROADCAST_DRIVER=pusher
PUSHER_APP_ID=your_app_id
PUSHER_APP_KEY=your_app_key
PUSHER_APP_SECRET=your_secret
PUSHER_APP_CLUSTER=ap2

Support

For issues and questions: