Treblle for Laravel

Learn how to get started with Treblle using our Laravel package in less than 2 minutes on any new or existing API

Step 1

Install Treblle via Composer

Run command

composer require treblle/treblle-laravel

You can ⭐ our Github repo to stay up to date with new updates

View on Github

Go to Step 2
Step 2

Run our Artisan auto installer

Run command

php artisan treblle:start

Get an API KEY and PROJECT ID without ever leaving your console

Go to Step 3
Step 3

Enable Treblle on your API

Edit routes/api.php

Route::middleware(['treblle'])->group(function () {
// YOUR API ROUTES GO HERE
Route::prefix('samples')->group(function () {
Route::get('{uuid}', [SampleController::class, 'view']);
Route::post('store', [SampleController::class, 'store']);
});
});

Add the treblle middleware on your API route group

Go to Step 4
Done

🎉 You're all set! 🎉

You and your team just got these amazing features:

  • Real-time API monitoring
  • Auto-generated API documenation
  • API analytics
  • Powerfull request search and filtering
  • 1-click API testing
  • Real-time problem detection
  • OpenAPI Specification support
  • Location based request tracking
  • Smart URL parameters detection
  • and many more..
Optional

Configuration params

Disable monitoring on specific environments

// Add this to your .env file
TREBLLE_IGNORED_ENV=local,dev,test

Define the Laravel environments you want Treblle to ignore

Mask sensitive data

return [
 
// other config
 
// Edit masked_fields array in config/treblle.php
'masked_fields' => [
'password',
'pwd',
'secret',
'password_confirmation',
'cc',
'card_number',
'ccv',
'ssn',
'credit_score',
'api_key',
],
];

PRO TIP: Data is masked before it even leaves your server

Need help getting started with Treblle on your API?

Book a meeting