A lightweight VS Code / Cursor extension to execute PHP code directly in Artisan Tinker from a dedicated sidebar panel β no terminal, no file switching, no setup.
Developed by abcprintf Β· workitdee.com
| Feature | Description |
|---|---|
| π₯οΈ Sidebar Panel | Dedicated panel in Activity Bar, always accessible, theme-aware |
| π¨ PHP Code Editor | Syntax highlighting, line numbers, bracket matching & auto-close β powered by CodeMirror |
| β‘ Quick Execution | Run PHP code via php artisan tinker --execute safely |
| π Stop Process | Kill a runaway or infinite-loop process instantly with the Stop button |
| π Execution History | Auto-saves successful snippets (up to 15) with timestamps |
| π Search History | Filter history dropdown in real-time by keyword |
| π¨ Pretty-Print Output | Auto-formats JSON and var_dump/print_r output for readability |
| β±οΈ Execution Time | Shows elapsed milliseconds after each run |
| π Copy / Clear Output | One-click copy to clipboard or clear the output area |
| π‘οΈ Friendly Error Messages | Human-readable errors for PHP not found, missing artisan, and crashes |
| β¨οΈ Keyboard Shortcut | Ctrl+Enter / Cmd+Enter to execute instantly |
| π Auto Theme Sync | UI adapts automatically to any VS Code / Cursor theme |
| π PHP Path Auto-Detect | Detects php from PATH automatically; override in settings |
| β° Timeout Guard | Kills runaway processes after a configurable timeout (default 30s) |
| β‘ Execution Cache | Caches results for identical code within a TTL window (default 30s) |
| π³ Sail / Docker Auto-Detect | Detects vendor/bin/sail and switches to sail tinker automatically |
| πͺ WSL Support | Routes execution via wsl for WSL workspace paths |
| π Persistent REPL | Optional toggle to keep a single Tinker process alive between runs |
| ποΈ Query Log Viewer | Auto-detects DB::getQueryLog() output and renders as an interactive table |
| π Share via Gist | Share code + output as a secret GitHub Gist with one click |
| π§ͺ Test Runner | Run php artisan test directly from the sidebar panel |
| π Usage Analytics | Local-only stats: runs, cache hits, shares, and tests (never leaves your machine) |
| π Interactive Tutorial | 5-step guided walkthrough shown automatically on first install |
| π¦ Zero Config | Just open a Laravel project and start tinkering |
| π Safe Execution | shell: false prevents shell injection; each run is isolated |
- Open VS Code or Cursor
- Press
Ctrl+Shift+X(Extensions) - Search:
Artisan Tinker Runner - Click Install β Reload when prompted
- Download the latest
.vsixfrom the Marketplace - In VS Code:
Ctrl+Shift+PβExtensions: Install from VSIX... - Select the downloaded file
1. Open a Laravel project (must contain `artisan` in root)
2. Click the πͺ icon in the Activity Bar
3. Type or paste PHP code in the editor
4. Press βΆ Execute or Ctrl+Enter / Cmd+Enter
5. View formatted output instantly below
6. Use the π History dropdown (or search box) to recall previous snippets
// Count records
User::count();
// Inspect environment
app()->environment();
// Pretty-print an array (auto-formatted)
dump(config('app'));
// Complex query
App\Models\Order::with('user')->where('status', 'pending')->get();
// Capture query log
DB::enableQueryLog();
User::all();
$q = DB::getQueryLog();
return $q;| Action | Windows / Linux | macOS |
|---|---|---|
| Execute | Ctrl + Enter |
Cmd + Enter |
| Stop process | Click β Stop button | Same |
| Setting | Default | Description |
|---|---|---|
artisan-tinker-runner.phpPath |
"" |
Custom PHP executable path. Empty = auto-detect from PATH |
artisan-tinker-runner.timeout |
30 |
Execution timeout in seconds before the process is killed |
artisan-tinker-runner.cacheEnabled |
true |
Cache results for identical code within the TTL window |
artisan-tinker-runner.cacheTtl |
30 |
Cache time-to-live in seconds |
| Issue | Solution |
|---|---|
β PHP not found |
Ensure php is in PATH. Test: php -v in terminal |
β No artisan file found |
Open the Laravel project root as workspace (not a subfolder) |
| Blank / white webview | Open Webview Developer Tools β Console tab for details |
(ΰΉΰΈ‘ΰΉΰΈ‘ΰΈ΅ΰΈΰΈ₯ΰΈ₯ΰΈ±ΰΈΰΈΰΉ) shown |
Use echo, return, or dump() β --execute only captures explicit output |
| Process hangs | Click β Stop to kill the process immediately |
| History not saving | Check Webview Console for localStorage errors |
- π Website: workitdee.com
- π€ Author: abcprintf
