// docs

Placeholder templates

Put {placeholders} in a snippet or command and fill in the values before the run.

A placeholder template is a Tinker snippet or Artisan command with {placeholder} markers in it. When Run Code sees them, it prompts for a value for each one and substitutes it before running, so a single saved template stands in for a whole family of one-off checks. This is a free feature.

User::query()
    ->where('created_at', '<', now()->subDays({days}))
    ->count();

How it works

  • Write {days}, {email}, {tenantId}, or any other name where a value should go.
  • Run the snippet or command; Run Code asks for each placeholder value.
  • Values are substituted as strings before the run, so the same template covers many inputs.