Skip to content

Tinker

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 return needed: the code runs through PsySH as artisan tinker does, so use statements 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.

  • 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.