Laravel Tinker

A powerful REPL console for interacting with a full Laravel application from the command line

Tool
Composer
vv3.0.2
7,439stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
69/100Good
Development Activity60
Maintenance60
Community56
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
77/100Good
Architecture75
Code Quality82
Innovation60
Learning Curve92

Laravel Tinker is the official REPL (read-eval-print loop) for Laravel, built on top of PsySH, that boots a full Laravel application and drops the developer into an interactive PHP shell with access to Eloquent models, service container bindings, config, and helper functions exactly as they exist at runtime.

It ships as the php artisan tinker command and is included by default in every new Laravel application, making it the standard way to quickly query the database, test a snippet of business logic, or inspect application state without writing a throwaway script or route.

What You Get

  • The php artisan tinker command, wired in automatically via TinkerServiceProvider on every Laravel app
  • A PsySH-backed REPL with tab completion, multi-line editing, and Laravel-aware value casters (TinkerCaster) for pretty-printing Eloquent models and collections
  • A whitelist of safe Artisan commands (migrate, env, optimize, etc.) runnable directly from inside the shell
  • A ClassAliasAutoloader that lets classes be referenced by short alias names inside the REPL session
  • An --execute flag for running a single expression non-interactively and returning raw output, useful for scripting

Common Use Cases

  • Quickly querying or updating records via Eloquent models during local debugging without writing a route
  • Exploring an unfamiliar Laravel codebase’s models, relationships, and config interactively
  • Testing a snippet of business logic (e.g. a scope, an event dispatch) before committing it to a controller
  • Running one-off data fixes or investigations in production/staging via artisan tinker --execute

Under The Hood

Architecture — The package is deliberately small: TinkerServiceProvider registers the tinker Artisan command and merges the package’s config/tinker.php (which whitelists both safe Artisan commands and auto-aliased namespaces); Console/TinkerCommand does the real work, building a PsySH Configuration from the current input, registering TinkerCaster so the shell can render Eloquent models/collections nicely, and handing control to Psy\Shell::run() for the interactive loop. ClassAliasAutoloader implements PHP’s autoloading SPL interface to resolve short class aliases (e.g. App\Models\User as User) declared in config. Tech Stack — PHP 8.1+, built directly on psy/psysh (the underlying REPL engine) and symfony/var-dumper for value formatting, with illuminate/console/illuminate/contracts/illuminate/support as the Laravel-framework integration points; supports Laravel 8 through 13 via a broad version constraint. Code Quality — The codebase is four source files total, each single-responsibility (service provider, command, caster, autoloader), with a PHPUnit test suite (ClassAliasAutoloaderTest, TinkerCasterTest) and phpstan.neon.dist for static analysis, reflecting Laravel core’s typical maintenance bar for first-party packages. API Design — There is effectively zero setup: the command is auto-registered and auto-discovered by Laravel’s package-discovery mechanism, and the whitelisted-commands/auto-alias config is the only surface a developer needs to touch, which keeps the tool’s learning curve close to zero for anyone already using Artisan.

Used by 19 apps in this directory

Other

Akaunting

Invoicing Finance

10,070

Open-source online accounting for small businesses and freelancers — invoices, expenses, and reporting without monthly fees or vendor lock-in.

View details
98
Repo Health
73
Technical
63
Dependency
Updated yesterday
PHP
72%
MIT

Bagisto

Analytics · Ecommerce

27,983

Open-source Laravel eCommerce platform for building multi-vendor marketplaces, B2B stores, headless commerce, and AI-powered storefronts.

View details
93
Repo Health
75
Technical
69
Dependency
Built with
PHP72%
Blade22%
Updated today
PHP
100%
Other

Cachet

Monitoring

15,220

The open-source, self-hosted status page system that keeps your users informed during outages and maintenance windows.

View details
86
Repo Health
67
Technical
76
Dependency
Built with
PHP100%
Updated 2 days ago
PHP
79%
Apache 2.0

Coolify

Devops · Hosting Control Panel

60,738

Open-source self-hosted PaaS — deploy apps, databases and 280+ services on your own servers with no vendor lock-in

View details
92
Repo Health
86
Technical
72
Dependency
Built with
PHP79%
Blade18%
Updated yesterday
PHP
48%
AGPL 3.0

Crater

Invoicing Finance

8,341

Open source invoicing and billing platform for freelancers and small businesses — create estimates, track expenses, accept Stripe payments, and run recurring invoices from your own server.

View details
54
Repo Health
68
Technical
69
Dependency
Built with
PHP48%
Vue40%
Updated 2 years ago
PHP
82%
MIT

Databasement

Databases · Devops · Developer Tools

1,974

Self-hosted database backup manager with a web UI for scheduling, encrypting, and restoring MySQL, PostgreSQL, MongoDB, SQL Server, SQLite, Firebird, and Redis to S3, SFTP, Samba, or local storage.

View details
81
Repo Health
77
Technical
69
Dependency
Built with
PHP82%
Blade17%
Updated 4 days ago
Vue
54%
GPL 3.0

Financial Freedom

Invoicing Finance

2,910

Own your financial data with a self-hosted, privacy-first budgeting app that replaces Mint and YNAB.

View details
49
Repo Health
67
Technical
75
Dependency
Built with
Vue54%
PHP44%
Updated 3 months ago
JavaScript
70%
AGPL 3.0

Fleetbase

Logistics

2,510

Modular open-source logistics and supply chain operating system

View details
91
Repo Health
75
Technical
68
Dependency
Built with
JavaScript70%
PHP10%
Updated today
PHP
91%
AGPL 3.0

FreeScout

Customer Support

4,484

Run your own help desk and shared inbox — a fully self-hosted, open-source alternative to Zendesk and Help Scout with no per-agent fees.

View details
93
Repo Health
55
Technical
63
Dependency
Built with
PHP91%
Updated yesterday

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search