Tinker
▲ laraport › Production › shop-app-1 › Tinker ● ssh shop.example.com Tinker · shop-app-1 PRODUCTION 38 ms · 41.5 MB 1 User::where('plan', 'pro')->count() result = 1284 LARAPORT Production shop-app-1 ctrl+r/f5 run ctrl+p/n history pgup/pgdn scroll output
Tinker runs PHP in the booted Laravel app of the container. You write code in the editor on top and see the result below:
- whatever the code prints;
- the value of the last expression, dumped with VarDumper. No
returnneeded: the code runs through PsySH asartisan tinkerdoes, sousestatements work; - for an exception, its class, message and location;
- the run time and peak memory.
use App\Models\Order;
Order::where('status', 'failed')->latest()->take(5)->get(['id', 'total']);| Key | Action |
|---|---|
ctrl+r or f5 |
Run |
esc |
Stop a running snippet |
ctrl+p / ctrl+n |
Previous / next snippet from the history |
ctrl+l |
Clear the output |
The history is kept per server and container in ~/.config/laraport/history.json, with the history settings.
Safety
Section titled “Safety”- The code travels over stdin, base64-encoded. Quotes never matter and the code never shows up in process listings on the server.
- In a production app (
APP_ENV=production), the first run asks for confirmation.