# laravel/tinker

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/laravel-tinker).**

7,433 stars · 139 forks · PHP · MIT

## Links

- GitHub: https://github.com/laravel/tinker
- Homepage: https://laravel.com/docs/artisan#tinker
- awesome-repositories: https://awesome-repositories.com/repository/laravel-tinker.md

## Topics

`laravel` `psysh` `repl` `tinker`

## Description

Laravel Tinker is an interactive shell that boots the full Laravel application context, allowing you to run PHP code, test models, and experiment with the framework in real time from the command line. It integrates PsySH as its underlying REPL engine, providing features like automatic namespace resolution, command history persistence, and on-demand class loading through Composer's autoloader.

The tool handles the full lifecycle of a Laravel console command, from defining input signatures and prompting for missing arguments to executing commands programmatically and queuing them for background processing. It also includes mechanisms for preventing concurrent command execution, listening to operating system signals, and writing formatted output such as colored text, tables, and progress bars to the terminal.

Beyond the core REPL experience, Tinker supports registering commands from custom directories, customizing generated file stubs, and hooking into command lifecycle events for additional logic or logging. The documentation covers installation, configuration, and usage through the standard Laravel package publishing workflow.

## Tags

### Development Tools & Productivity

- [Interactive REPLs](https://awesome-repositories.com/f/development-tools-productivity/interactive-repls.md) — Runs an interactive command-line shell that loads the full application context for live code experimentation. ([source](https://cdn.jsdelivr.net/gh/laravel/tinker@3.x/README.md))
- [Laravel REPLs](https://awesome-repositories.com/f/development-tools-productivity/interactive-repls/laravel-repls.md) — Provides an interactive shell that boots the full Laravel application context for live code experimentation.
- [Application Context Bootstrappers](https://awesome-repositories.com/f/development-tools-productivity/agentic-application-bootstrappers/application-context-bootstrappers.md) — Loads the Laravel service container, configuration, and facades before entering the interactive shell session.
- [REPL Integrations](https://awesome-repositories.com/f/development-tools-productivity/command-configuration-utilities/external-command-integrations/debugger-command-apis/repl-integrations.md) — Integrates PsySH as the underlying REPL engine for evaluating PHP expressions interactively.
- [Real-Time Code Evaluation](https://awesome-repositories.com/f/development-tools-productivity/configuration-updates/real-time-runtime-updates/real-time-code-evaluation.md) — Evaluates arbitrary PHP expressions and statements in real time within the application's runtime environment.
- [PsySH-Based REPL Engines](https://awesome-repositories.com/f/development-tools-productivity/interactive-repls/web-based-repls/psysh-based-repl-engines.md) — Embeds the PsySH runtime debugger as the interactive shell engine for autocompletion, history, and runtime introspection.
- [Programmatic Command Invokers](https://awesome-repositories.com/f/development-tools-productivity/cli-command-extensions/programmatic-command-invokers.md) — Runs a command from within application code, such as a route or controller, and retrieves its exit code. ([source](https://laravel.com/docs/artisan#tinker))
- [Command Chaining](https://awesome-repositories.com/f/development-tools-productivity/cli-command-frameworks/cli-command-registrars/command-chaining.md) — Invokes one command from within another, optionally suppressing its output. ([source](https://laravel.com/docs/artisan#tinker))
- [Signature-Based Input Parsers](https://awesome-repositories.com/f/development-tools-productivity/command-argument-parsers/signature-based-input-parsers.md) — Defines required and optional arguments and options for console commands using a concise signature syntax.
- [Missing Argument Prompts](https://awesome-repositories.com/f/development-tools-productivity/command-line-argument-handlers/missing-argument-prompts.md) — Automatically prompts users for required command arguments that were not provided at invocation. ([source](https://laravel.com/docs/artisan#tinker))
- [Command Options](https://awesome-repositories.com/f/development-tools-productivity/command-options.md) — Accesses user-supplied arguments and options from within command execution logic. ([source](https://laravel.com/docs/artisan#tinker))
- [Command Signature Declarations](https://awesome-repositories.com/f/development-tools-productivity/command-options/command-signature-declarations.md) — Declares a command's name, arguments, and options using a compact, route-like syntax within the command class. ([source](https://laravel.com/docs/artisan#tinker))
- [Command Signature Definitions](https://awesome-repositories.com/f/development-tools-productivity/command-options/command-signature-definitions.md) — Specifies required and optional arguments and options for console commands using a concise signature syntax. ([source](https://laravel.com/docs/artisan))
- [Programmatic](https://awesome-repositories.com/f/development-tools-productivity/command-runners/programmatic.md) — Executes Artisan commands programmatically from application code and retrieves their exit codes.
- [Composer Autoloader Integrations](https://awesome-repositories.com/f/development-tools-productivity/plugin-autoloading/composer-autoloader-integrations.md) — Loads application classes and dependencies on demand during REPL sessions using Composer's autoloader.

### Programming Languages & Runtimes

- [Automatic Import Resolution](https://awesome-repositories.com/f/programming-languages-runtimes/automatic-import-resolution.md) — Resolves and imports class names automatically within the REPL session based on the application's namespace map.
- [Application-Context REPL Shells](https://awesome-repositories.com/f/programming-languages-runtimes/dynamic-class-creation/class-loading-mechanisms/preloading/interactive-shell/database-repl-shells/application-context-repl-shells.md) — Opens an interactive PHP shell that boots the full Laravel application context for live code experimentation.
- [Laravel REPL Shells](https://awesome-repositories.com/f/programming-languages-runtimes/dynamic-class-creation/class-loading-mechanisms/preloading/interactive-shell/database-repl-shells/laravel-repl-shells.md) — Provides an interactive command-line shell that loads the full Laravel application context for live code experimentation.
- [Namespace Resolvers](https://awesome-repositories.com/f/programming-languages-runtimes/namespace-resolvers.md) — Resolves and imports class names automatically within the REPL session based on the application's namespace map.

### Software Engineering & Architecture

- [Laravel](https://awesome-repositories.com/f/software-engineering-architecture/application-bootstrapping/laravel.md) — Boots the full Laravel application context before entering the interactive shell session.

### System Administration & Monitoring

- [Console Output Formatting](https://awesome-repositories.com/f/system-administration-monitoring/log-output-formatting/console-output-formatting.md) — Writes colored text, tables, and progress bars to the console to communicate status and results. ([source](https://laravel.com/docs/artisan))
- [Formatted Console Outputs](https://awesome-repositories.com/f/system-administration-monitoring/log-output-formatting/formatted-console-outputs.md) — Writes colored text, tables, and progress bars to the terminal for status and results. ([source](https://laravel.com/docs/artisan#tinker))
- [Command History Persistence](https://awesome-repositories.com/f/system-administration-monitoring/request-history-persistence/command-history-persistence.md) — Stores and retrieves previously executed REPL commands across sessions using a file-based history system.

### User Interface & Experience

- [Input Selection Prompts](https://awesome-repositories.com/f/user-interface-experience/input-selection-prompts.md) — Asks users for text, secrets, or selections during command execution with defaults and validation. ([source](https://laravel.com/docs/artisan#tinker))
