finds.dev← search

// the find

calebporzio/sushi

★ 3,002 · PHP · MIT · updated Feb 2026

Eloquent's missing "array" driver.

Sushi lets you back an Eloquent model with a static PHP array instead of a database table, using a hidden SQLite file under the hood. It's aimed at Laravel apps that need fixture data — countries, roles, settings — modeled as first-class Eloquent citizens without a real table. The trick is clever enough that it ships with 3k stars from people tired of scattering config arrays across their codebases.

The SQLite-backed approach means you get real SQL queries, not a filtered in-memory collection — so whereHas works on the SQLite side, scopes work, pagination works, and you don't have to think about it. The getRows() override lets you pull from an external source (CSV, API) and still get the full Eloquent query interface, which is a genuinely useful escape hatch. Cache invalidation is handled by comparing mtime of the model file against the .sqlite file, which is dumb-simple and correct for the 99% case. Relationships to real database models work bidirectionally, including eager loading.

The cross-database limitation is real and hits you at an awkward moment: whereHas against a Sushi model silently doesn't work because the two models live on different connections, and the error message won't tell you why. Concurrency on the SQLite cache file is unguarded — two requests that simultaneously trigger a cache rebuild will race, and in the best case one silently wins; in the worst case you get a corrupted sqlite file. The package is a single ~200-line trait, which is fine for what it does, but that also means zero support for joins across Sushi models or cross-model aggregates. Requiring pdo-sqlite as an extension dependency is a production gotcha — it's not always present on managed hosting or in Docker images built from slim base images.

View on GitHub → Homepage ↗

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →