gitmyhub

tinker

PHP ★ 7.4k updated 2d ago

Powerful REPL for the Laravel framework.

An interactive PHP console built into every Laravel project that lets you query your database, test code, and run commands directly against your running application from the terminal without writing a script.

PHPLaravelPsySHsetup: easycomplexity 1/5

Laravel Tinker is an interactive console tool for the Laravel web framework, a PHP framework commonly used to build web applications and APIs. REPL stands for Read-Eval-Print Loop, which describes a shell where you type a command, the tool runs it immediately, shows you the result, and then waits for the next input. Developers use this kind of tool to quickly test code, inspect data, or experiment with parts of their application without writing a full script or opening a browser.

Tinker is built on top of PsySH, an open-source interactive PHP shell. Because it runs inside your Laravel application, it has access to all of your database models, configuration values, and services. This means you can query your database, create test records, or call any function in your codebase directly from the terminal. It is included by default in new Laravel projects.

The README for this repository is very short. It describes Tinker in one sentence and directs readers to the official Laravel documentation website for full usage instructions. No setup steps or code examples are given here; all of that lives on the external docs site.

If you use Laravel and want to quickly check what a piece of code does, look at data in your database, or run a one-off command against your application, Tinker is the built-in tool for that. You start it from the terminal using the artisan command-line interface that comes with every Laravel project. The source code is licensed under the MIT license and open to contributions.

Where it fits