calebporzio/sushi

Eloquent's missing "array" driver.

View on GitHub ↗Jump to charts ↓

calebporzio/sushi has 3k+ stars and 150+ forks on GitHub, is written in PHP, and was last pushed on Feb 21, 2026. Data as of . Signed-in members get hourly updates — create a free account.

Summary Information

Updated 1 hour ago
Added to GitGenius on September 23rd, 2026
Created on January 25th, 2020
Open Issues & Pull Requests: 22 (+0)
GitHub issues: Disabled - open counts may still include pull requests.
Number of forks: 182
Total Stargazers: 3,007 (+0)
Total Subscribers: 39 (+0)

Repository Insights (GitGenius)

Most active contributors

Sign in to see contributor activity.
Sign in

Related repositories by overlapping contributors

No overlapping-contributor repos identified yet.

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

GitHub issues are disabled for this repository, so issue analytics and the issue explorer are not available.

Detailed Description

Sushi is a Laravel package that provides Eloquent's missing "array" driver, allowing you to use Eloquent models backed by in-memory or cached SQLite databases instead of traditional database tables.

The package solves the problem of needing Eloquent's query interface and relationship features for static or fixture data without setting up a database. It works by having you add the Sushi trait to a model and define a $rows property containing your data. The package then automatically creates and caches a SQLite database for that model, populating it with the supplied rows. If caching is unavailable, it falls back to an in-memory SQLite database. You can also implement a custom getRows() method to determine rows at runtime, even fetching them from external sources like APIs, with optional caching support.

Sushi suits projects that need to work with fixture data such as states, countries, zip codes, user roles, or site settings. It is particularly valuable when you want to leverage Eloquent's query syntax and relationships without database overhead. The tool supports standard Eloquent relationships to other models, database validation rules using the exists rule with fully-qualified model namespaces, and custom schema definition via a $schema property or getSchema() method. One important limitation is that the whereHas method does not work with Sushi models because they exist in a separate SQLite database from related models. The package requires the pdo-sqlite PHP extension.

The project maintains a caching system that monitors the last modified timestamp of your model file and automatically rebuilds the SQLite cache when the model changes, or you can configure an external file for cache invalidation. The tool supports advanced customization through an afterMigrate method, allowing you to add indexes or other table modifications after creation. The package originated as sponsorware and transitioned to fully open source after reaching its sponsorship goal.