Laravel Tinker

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

Tool
Composer
vv3.0.2
7,441 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
67 /100 Good
Development Activity 64
Maintenance 48
Community 56
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
77 /100 Good
Architecture 75
Code Quality 82
Innovation 60
Learning Curve 92

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

PHP
57%
Other

Hi.Events

Ecommerce · Scheduling

4,074

Self-hosted event ticketing platform that keeps your attendee data, brand, and revenue completely under your control.

View details
90
Repo Health
84
Technical
67
Dependency
Built with
PHP 57%
TypeScript 37%
Updated 5 days ago
PHP
84%
Other

Invoice Ninja

Invoicing Finance · Project Management

10,311

Self-hostable invoicing, time-tracking, and multi-gateway payment platform for freelancers and small businesses, with built-in e-invoicing compliance for EU and global standards.

View details
97
Repo Health
83
Technical
62
Dependency
Built with
PHP 84%
Updated 1 weeks ago
PHP
51%
MIT

Krayin CRM

CRM · Ecommerce

24,049

Free, open-source Laravel & Vue.js CRM for SMEs and enterprises to manage the complete customer lifecycle.

View details
90
Repo Health
68
Technical
67
Dependency
Built with
PHP 51%
Blade 41%
Updated 1 weeks ago
PHP
65%
AGPL 3.0

LinkStack

Marketing

3,914

Self-hosted, privacy-focused Linktree alternative with themes, analytics, and a drag-and-drop admin panel.

View details
74
Repo Health
56
Technical
68
Dependency
Built with
PHP 65%
Blade 35%
Updated 1 weeks ago
PHP
62%
Other

OpnForm

Forms Surveys · Marketing

3,865

Build unlimited, embeddable forms with no code — powered by AI, logic rules, and real-time analytics

View details
91
Repo Health
75
Technical
65
Dependency
Built with
PHP 62%
Vue 28%
Updated 6 days ago
PHP
70%
AGPL 3.0

Pixelfed

Social Media

7,129

A decentralized, self-hosted photo sharing platform built on ActivityPub for the open Fediverse.

View details
94
Repo Health
68
Technical
66
Dependency
Built with
PHP 70%
Vue 21%
Updated 6 days ago
PHP
76%
MIT

SendPortal

Marketing

2,180

Self-hosted email marketing with full data control, multi-workspace isolation, and seamless integration with Amazon SES, SendGrid, Mailgun, and more

View details
65
Repo Health
59
Technical
71
Dependency
Built with
PHP 76%
Blade 24%
Updated 1 weeks ago
PHP
47%
AGPL 3.0

solidtime

Invoicing Finance · Productivity

9,027

Modern open-source time tracker for freelancers and agencies with invoicing, multi-org support, and Toggl/Clockify migration built in.

View details
84
Repo Health
81
Technical
67
Dependency
Built with
PHP 47%
TypeScript 28%
Vue 22%
Updated 1 weeks ago
PHP
63%
AGPL 3.0

Vanguard Backup

Devops

37

Self-hosted backup automation for Ubuntu and Debian servers with S3 storage, SSH-based file and database backup, and multi-channel notifications.

View details
34
Repo Health
80
Technical
69
Dependency
Built with
PHP 63%
Blade 36%
Updated 11 months ago

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