whatisgithub

What is tinker?

laravel/tinker — explained in plain English

Analysis updated 2026-06-24

7,431PHPAudience · developerComplexity · 1/5LicenseSetup · easy

In one sentence

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.

Mindmap

mindmap
  root((tinker))
    What it does
      Interactive PHP console
      Live app access
      REPL for Laravel
    Capabilities
      Query database models
      Create test records
      Call any app function
    Built on
      PsySH shell
      Laravel artisan CLI
    Audience
      Laravel developers
      PHP developers
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Query your Laravel database models interactively from the terminal to inspect live data without writing a route or controller

USE CASE 2

Create test records or run one-off scripts against your Laravel application during development without a browser

USE CASE 3

Test a specific service method or piece of business logic in your Laravel app immediately without setting up a test file

What is it built with?

PHPLaravelPsySH

How does it compare?

laravel/tinkersebastianbergmann/php-text-templatesymfony/var-dumper
Stars7,4317,4377,440
LanguagePHPPHPPHP
Setup difficultyeasyeasyeasy
Complexity1/52/51/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

Included by default in every new Laravel project, start it with php artisan tinker from your project root.

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

So what is it?

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.

Copy-paste prompts

Prompt 1
Using Laravel Tinker, show me how to query all User records from my database, filter by email domain, and print the results directly from the terminal.
Prompt 2
How do I use Laravel Tinker to create a new user record using my User model and factory, then verify it was saved to the database?
Prompt 3
I want to call a method on a Laravel service class in Tinker. How do I resolve it from the service container and invoke it interactively?
Prompt 4
What artisan command starts Laravel Tinker, and how is it different from running plain php -a? What extra access does it give me to my app?

Frequently asked questions

What is tinker?

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.

What language is tinker written in?

Mainly PHP. The stack also includes PHP, Laravel, PsySH.

What license does tinker use?

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

How hard is tinker to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is tinker for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.