PHPackages                             thiago-vieira/saci - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Templating &amp; Views](/categories/templating)
4. /
5. thiago-vieira/saci

ActiveLibrary[Templating &amp; Views](/categories/templating)

thiago-vieira/saci
==================

A modern, elegant Laravel debugger that shows loaded views and their data in a floating bar

v2.4.1(5mo ago)023MITPHPPHP ^8.0|^8.1|^8.2|^8.3CI passing

Since Sep 8Pushed 5mo agoCompare

[ Source](https://github.com/thiagomrvieira/saci)[ Packagist](https://packagist.org/packages/thiago-vieira/saci)[ RSS](/packages/thiago-vieira-saci/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (1)Versions (17)Used By (0)

Saci 🔍
======

[](#saci-)

[![Tests](https://github.com/thiago-vieira/saci/actions/workflows/tests.yml/badge.svg)](https://github.com/thiago-vieira/saci/actions/workflows/tests.yml)[![Code Coverage](https://camo.githubusercontent.com/9389cdd11cf91b23299281636977020ef8c443cf47c222f1e29fb20f2f3a1826/68747470733a2f2f636f6465636f762e696f2f67682f74686961676f2d7669656972612f736163692f6272616e63682f6d61696e2f67726170682f62616467652e737667)](https://codecov.io/gh/thiago-vieira/saci)[![PHP Version](https://camo.githubusercontent.com/3f99b197569aa2dcfbefff17ecc68d74098e7f929d8b52dc40f3a898f740eae1/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e322532422d3737374242343f6c6f676f3d706870)](https://www.php.net/)[![Laravel](https://camo.githubusercontent.com/d81e9b9a0f516916ed6ac6b9c4ccd59f7c32f0d5e78f858ca0c7c407b09f6122/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d31302e7825323025374325323031312e782d4646324432303f6c6f676f3d6c61726176656c)](https://laravel.com/)

> A modern, zero-config Laravel debug bar that actually makes debugging fun (yes, really).

Track your Blade views, inspect requests, and peek into routes with a sleek, persistent UI that won't mess with your styles. Think of it as X-ray vision for your Laravel app.

Quick Start
-----------

[](#quick-start)

Install it:

```
composer require thiago-vieira/saci
```

Enable it:

```
SACI_ENABLED=true
```

That's it! 🎉 Saci works out of the box. No config files, no setup, no headaches.

**Optional** (but recommended for CSP):

```
php artisan vendor:publish --tag=saci-config
php artisan vendor:publish --tag=saci-assets
```

What's in the Box? 📦
--------------------

[](#whats-in-the-box-)

### 6 Powerful Data Collectors

[](#6-powerful-data-collectors)

Each one is like a little spy that watches different parts of your app:

- 🎨 **Views**: Which Blade templates loaded? What data did they receive? How long did it take?
- 🌐 **Request**: Full HTTP request/response details (headers, body, cookies, session... the works)
- 🛣️ **Route**: Controller info, middleware stack, parameters, constraints
- 👤 **Auth**: Who's logged in? Which guard? User details
- 📝 **Logs**: All your `Log::info()`, `Log::error()`, etc. in one place
- 🗄️ **Database**: SQL queries with bindings, execution time, **N+1 detection**, duplicate finder, stack traces

### UI That Doesn't Suck

[](#ui-that-doesnt-suck)

- **Persistent state**: Collapsed/expanded settings survive page refresh (because nobody likes clicking the same thing 47 times)
- **Resizable**: Drag it bigger or smaller, your call
- **Themes**: Default, dark, or minimal (for the minimalists)
- **CSP-friendly**: Works with Content Security Policy (because security matters)
- **Isolated styles**: Scoped CSS to avoid conflicts with your app styles

### Performance? We Got You

[](#performance-we-got-you)

- **Zero overhead when disabled**: Seriously, zero. Not "almost zero", actual zero
- **Lazy loading**: Full dumps only load when you click (fast initial page load)
- **Memory limits**: Won't blow up your app even with massive arrays
- **Modular**: Turn off collectors you don't need (more on this below)

Configuration 🎛️
----------------

[](#configuration-️)

### The Basics

[](#the-basics)

```
SACI_ENABLED=true                    # The master switch
SACI_THEME=default                   # default | dark | minimal
SACI_TRANSPARENCY=0.85               # 0.0 (invisible) to 1.0 (solid)
SACI_TRACK_PERFORMANCE=true          # Measure view loading times
SACI_ALLOW_AJAX=false                # ⚠️ Keep false! (breaks AJAX responses)
SACI_ALLOW_IPS=127.0.0.1,::1         # IP whitelist (empty = everyone)
```

### Data Collection Limits

[](#data-collection-limits)

```
# Preview Limits (shown inline before expanding)
SACI_PREVIEW_MAX_CHARS=70            # Max preview text length
SACI_PREVIEW_MAX_ITEMS=8             # Max array items in preview
SACI_PREVIEW_MAX_STRING=80           # Max string length in preview

# Full Dump Limits (lazy-loaded on click)
SACI_DUMP_MAX_DEPTH=5                # Max nesting depth for dumps
SACI_DUMP_MAX_ITEMS=10000            # Max array/object items to dump
SACI_DUMP_MAX_STRING=10000           # Max string length in dumps

# Storage Management
SACI_PER_REQUEST_BYTES=1048576       # Max storage per request (1MB)
SACI_DUMP_TTL=60                     # Auto-cleanup old dumps (seconds)
```

### Performance Tuning 🚀

[](#performance-tuning-)

Here's the cool part: each collector can be toggled on/off independently. **When off, it has ZERO overhead**. Not "almost zero", actual zero. Not instantiated, not executed, not even a tiny bit of memory used.

> **⚠️ About AJAX requests:** Keep `SACI_ALLOW_AJAX=false` unless you know what you're doing. Enabling it will inject the debug bar into AJAX responses, which will break your frontend if it expects JSON or partial HTML. Only enable for debugging full-page AJAX loads (Turbo, Livewire, etc).

```
SACI_COLLECTOR_VIEWS=true            # Blade view tracking
SACI_COLLECTOR_REQUEST=true          # HTTP request/response
SACI_COLLECTOR_ROUTE=true            # Route & controller info
SACI_COLLECTOR_AUTH=true             # Authentication data
SACI_COLLECTOR_LOGS=true             # Application logs
SACI_COLLECTOR_DATABASE=true         # SQL query tracking + N+1 detection
```

### Advanced Configuration

[](#advanced-configuration)

For edge cases and special requirements:

```
# Content Security Policy (CSP)
SACI_CSP_NONCE=your-nonce-here       # Add CSP nonce to inline scripts (if using strict CSP)

# Asset Serving
SACI_FORCE_INTERNAL_ASSETS=false     # Force internal asset routes even if published
                                     # (useful for Docker/containerized environments)
```

**When to use these:**

- `SACI_CSP_NONCE`: If your app has a strict Content Security Policy that blocks inline scripts
- `SACI_FORCE_INTERNAL_ASSETS`: When published assets don't match package version (cache issues, container deployments)

#### Real-World Examples

[](#real-world-examples)

**Debugging an API?** Views are useless:

```
SACI_COLLECTOR_VIEWS=false           # Skip it, save ~30% overhead
```

**Need to debug in production?** Go lightweight:

```
SACI_COLLECTOR_LOGS=false            # Logs can be heavy
SACI_COLLECTOR_AUTH=false            # Don't need user info
# Keep request + route for the actual debugging
```

**Only care about routing issues?** Laser focus:

```
SACI_COLLECTOR_VIEWS=false
SACI_COLLECTOR_REQUEST=false
SACI_COLLECTOR_AUTH=false
SACI_COLLECTOR_LOGS=false
SACI_COLLECTOR_ROUTE=true            # Just this one, please
```

**Performance impact:**

- ❌ Disabled = Zero overhead (literally not even loaded)
- ✅ Enabled = Minimal overhead (smart, optimized collection)

Database Tab 🗄️ - The Performance Detective
-------------------------------------------

[](#database-tab-️---the-performance-detective)

The Database collector is your first line of defense against slow queries and N+1 nightmares. It automatically watches every SQL query your app executes and gives you insights that would take hours to debug manually.

### What You Get

[](#what-you-get)

- **All Queries Listed**: Every single SQL statement, with bindings resolved
- **Execution Time**: See exactly how long each query took (slow queries &gt; 100ms highlighted in orange)
- **N+1 Detection**: Automatically spots N+1 patterns (like running `SELECT * FROM users WHERE id = ?` 50 times)
- **Duplicate Finder**: Identifies queries that run multiple times (candidates for caching)
- **Stack Traces**: Click any query to see exactly where in your code it was called
- **Smart Filters**: Search queries, show only slow ones, filter by type (SELECT, INSERT, etc.)

### Real-World Example

[](#real-world-example)

Say you're loading a list of blog posts with their authors:

```
$posts = Post::all();
foreach ($posts as $post) {
    echo $post->author->name; // 💀 N+1 ALERT!
}
```

**Without Saci:** "Hmm, this page is slow. Wonder why? 🤔"

**With Saci Database Tab:**

```
⚠️ N+1 Queries Detected!
Pattern: SELECT * FROM users WHERE id = ?
Executed 47× (234ms total)

```

**Fix it:**

```
$posts = Post::with('author')->all(); // Eager load, 2 queries total 🚀
```

### Use Cases

[](#use-cases)

- **Find slow queries**: Sort by time, identify bottlenecks
- **Optimize N+1**: The tab literally tells you "hey, this is an N+1"
- **Reduce redundant queries**: See duplicates, add caching
- **Debug ORM issues**: See the actual SQL your Eloquent code generates
- **Production monitoring**: Keep it on in staging to catch issues before prod

### Memory Management

[](#memory-management)

Because nobody likes memory leaks:

```
SACI_PER_REQUEST_BYTES=1048576       # Cap per request (tweak if needed)
SACI_DUMP_TTL=60                     # Old dumps? Gone. (in 60s)
```

Architecture (for the Nerds) 🤓
------------------------------

[](#architecture-for-the-nerds-)

Saci uses the **Collector Pattern** - the same battle-tested approach as Symfony Profiler and Laravel Telescope.

```
CollectorRegistry (the boss)
  ├── ViewCollector (watches Blade)
  ├── RequestCollector (watches HTTP)
  ├── RouteCollector (watches routing)
  ├── AuthCollector (watches users)
  └── LogCollector (watches logs)

```

**Why this is awesome:**

- Each collector = one job (single responsibility)
- Add new collectors without touching the core (open/closed principle)
- Super easy to test (isolated units)
- Industry-standard pattern (proven in production)

Want to know more? Check `ARCHITECTURE.md` for the deep dive.

Want to Extend It? 🔧
--------------------

[](#want-to-extend-it-)

Got custom tracking needs? Create your own collector in ~50 lines:

```
use ThiagoVieira\Saci\Collectors\BaseCollector;

class DatabaseCollector extends BaseCollector
{
    public function getName(): string { return 'database'; }
    public function getLabel(): string { return 'Database'; }

    protected function doStart(): void {
        // Start listening for queries
        DB::listen(fn($query) => $this->queries[] = $query);
    }

    protected function doCollect(): void {
        // Store collected data
        $this->data = [
            'queries' => $this->queries,
            'total_time' => array_sum(array_column($this->queries, 'time')),
        ];
    }
}
```

Register it in `SaciServiceProvider`:

```
$registry->register($app->make(DatabaseCollector::class));
```

Boom! Your custom collector is now part of Saci. No core changes needed.

Want to build something cool? Full guide at `src/Collectors/README.md`.

Why "Saci"? 🤔
-------------

[](#why-saci-)

Named after [Saci](https://en.wikipedia.org/wiki/Saci_(Brazilian_folklore)) from Brazilian folklore - a one-legged trickster who knows everything happening in the forest. Like our debug bar, he sees everything that's going on.

Plus, "Saci" is fun to say. Try it: *Sah-see*. See? Fun.

License
-------

[](#license)

MIT - Go wild, just don't blame us if it reads your mind 😉

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance71

Regular maintenance activity

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~5 days

Total

16

Last Release

171d ago

Major Versions

v1.1.0 → v2.0.02025-10-05

PHP version history (2 changes)v1.1.0PHP ^7.3|^8.0|^8.1|^8.2|^8.3

v2.0.0PHP ^8.0|^8.1|^8.2|^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/5e2155eecc43859d412a3dd62839d514cd0311f656cd413955cd2d2a866fc502?d=identicon)[thiagomrvieira](/maintainers/thiagomrvieira)

---

Top Contributors

[![thiagomrvieira](https://avatars.githubusercontent.com/u/14181429?v=4)](https://github.com/thiagomrvieira "thiagomrvieira (53 commits)")

---

Tags

laraveldebugbladedevelopmentviewstracersaci

### Embed Badge

![Health badge](/badges/thiago-vieira-saci/health.svg)

```
[![Health](https://phpackages.com/badges/thiago-vieira-saci/health.svg)](https://phpackages.com/packages/thiago-vieira-saci)
```

###  Alternatives

[igaster/laravel-theme

Laravel Themes: Asset &amp; Views folder per theme. Theme inheritance. Blade integration and more...

5161.2M12](/packages/igaster-laravel-theme)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
