Skip to content

YanGusik/phppad_packed

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

PHPpad

A free, open-source desktop PHP REPL for Laravel — an alternative to Tinkerwell. Connect to your project via SSH or Docker, run PHP code interactively, and inspect results with a rich UI.

If you find this project useful, please consider giving it a ⭐ on GitHub — it really helps!

PHPpad main screen


Features

  • SSH & Docker connections — connect to any remote server or Laravel Sail container
  • Magic comments — inline value capture without changing your code flow
  • Smart results — tree view, table view, CSV export
  • SQL query log — see every query with execution time and bound parameters
  • LSP autocomplete — powered by phpactor, with auto-use imports
  • Snippets & History — save reusable code, browse past executions
  • Multiple tabs — work on several scripts simultaneously
  • Artisan panel — browse, search and run any artisan command with live output
  • Log Viewer — browse Laravel log files with filtering, search, stack traces and source preview
  • 8 themes — dark and light options

Connections

PHPpad runs your code on the remote machine where your Laravel project lives — nothing is installed on the project itself.

Connections

SSH

  • Host, port, username
  • Auth: Password or Private Key (with optional passphrase)
  • Project path on the remote server

Docker

  • Select from running containers (docker ps)
  • Working directory inside the container
  • Works with Laravel Sail out of the box

Test Connection verifies SSH/Docker access and checks Laravel bootstrap before saving. Switch between connections at any time from the status bar at the bottom.


Running Code

Press Ctrl+Enter (or the ▶ button) to execute. The runner script is deployed automatically to /tmp/.tw_lite_runner.php on first run and re-deployed only when it changes (SHA1 hash check).

Results appear below the editor:

  • Return values from expressions
  • All dump() / dd() calls in order
  • SQL queries with timing
  • Exceptions with stack traces
  • PHP version and total execution duration in the status bar

Magic Comments

Capture intermediate values inline without modifying your code flow.

Magic comments

//? — capture line value

$users = User::find(36)->id; //?
// ← 36

Shows the value inline next to the code line. Works on single-line statements and multi-line expressions ending with ];.

/*?*/ — capture mid-chain

collect([1, 2, 3])/*?->count()*/->map(fn($x) => $x * 2);
// ← 3

Captures a value in the middle of a method chain without breaking it. The original value is passed through so the chain continues normally. You can also call a method just for display: /*?->count()*/ shows the count() result but passes the original collection forward.

/*?.*/ — timing

$result = User::all();
/*?.*/;
// ← "12.4ms"

Shows elapsed time in milliseconds since script start at that point. Useful for profiling slow queries or operations.


Results

Tree View

Default view for all values — expandable arrays and objects, type-aware coloring, hidden properties toggle for Eloquent models (shows password, remember_token etc. on demand).

Table View + CSV Export

Automatically activated when the result is a uniform collection (e.g. DB::select(...), User::all(), collect([...]) with identical keys per row).

Table view with SQL

Table from collection

Toggle between Tree and Table with the buttons on the result card. Export to CSV with one click.

SQL Log

All queries executed during the run are captured with bound parameters substituted and per-query timing. Click the SQL button in the toolbar to toggle visibility.


Snippets & History

Open with Ctrl+B or the bookmark icon in the sidebar.

Snippets panel

Snippets

  • Save any code as a named snippet
  • Search by name or content
  • Press Enter to insert into the editor, Esc to close
  • Right-click in editor → "Add to Snippets" or "Add selected code to Snippets"
  • 6 built-in examples: magic comments, Eloquent queries, collections, raw DB queries, string helpers

History

History panel

  • Every run is saved automatically (up to 100 entries)
  • Shows connection name, timestamp, and execution duration
  • Search by code content or connection name
  • Open — load into editor; Create Snippet — save permanently

Artisan Panel

Browse, search and run any Laravel artisan command without leaving the editor.

Artisan panel

  • Commands listed and grouped by namespace (cache, config, db, env, make, migrate, queue…)
  • Search by command name or description
  • Shows command usage syntax and accepts arguments/options in the input field
  • Output displayed in a terminal-style pane with live scrolling
  • Laravel framework version shown in the title bar

Open with the > button in the sidebar.


Log Viewer

Inspect Laravel log files directly from the connected server or container — no need to tail manually.

Log viewer

  • File list — shows all .log files found in storage/logs, logs, var/log, sorted by modification time
  • Level filter — filter by DEBUG / INFO / NOTICE / WARNING / ERROR / CRITICAL / ALERT / EMERGENCY
  • Search — full-text search across message and context
  • Detail panel — click any entry to expand:
    • Stack Trace tab — exception class, message, source file with PHP syntax highlighting and error line highlighted; full stack trace with clickable frames to jump to any location
    • Raw tab — full message and JSON context
  • Supports both standard Monolog format and Laravel's allowInlineLineBreaks variant
  • Parses context.exception and context.error keys for exception extraction

Open with the log file icon in the sidebar.


Themes

8 themes with live preview — choose in Settings → Appearance (Ctrl+,).

Themes

Theme Mode
Catppuccin Mocha Dark
Dracula Dark
Nord Dark
Tokyo Night Dark
Rosé Pine Dark
One Dark Dark
GitHub Light Light
Catppuccin Latte Light

Autocomplete (LSP)

Powered by phpactor — a full PHP language server running locally over WebSocket.

  • Class and method completion with docblock types
  • Auto-inserts use statements on completion
  • Reads your project's vendor/composer/autoload_classmap.php for class names
  • Priority: App\ModelsApp\Illuminate\FacadesIlluminate\
  • Signature hints for function parameters

Status shown in the editor hint: ⚡ LSP (connected) or ○ LSP (loading).


Keyboard Shortcuts

Shortcut Action
Ctrl+Enter Run code
Ctrl+Space Trigger autocomplete
Shift+Alt+L Format code (Prettier)
Ctrl+, Open Settings
Ctrl+B Toggle Snippets / History
Ctrl+T New tab
Ctrl+W Close tab
Ctrl+Tab Next tab
Ctrl+Shift+Tab Previous tab
Ctrl+1..9 Jump to tab N
Esc Close modal

Requirements

  • Node.js 20+
  • PHP 8.1+ on the remote server / Docker container (where your Laravel project runs)
  • Laravel project with vendor/autoload.php and artisan

No Composer packages need to be installed in your Laravel project.

Platform support

Platform Code execution LSP autocomplete
macOS ✅ native ✅ requires php in PATH
Linux ✅ native ✅ requires php in PATH
Windows ✅ native ✅ requires WSL with php installed

Windows: The app runs and executes code natively without WSL. WSL is only needed for LSP autocomplete — phpactor runs inside WSL via wsl.exe. If WSL is not available, the editor works normally without autocompletion.


Development

npm install
npm run dev

Build

npm run dist:win   # Windows installer (.exe)
npm run dist:mac   # macOS image (.dmg)

About

PHPpad is a lightweight desktop PHP REPL for Laravel developers. You write PHP code, press Ctrl+Enter, and it runs directly in the context of your Laravel project via SSH or Docker. You see results, SQL queries, and variable values ​​inline. With 90% of the functionality implemented. Like Tinkerwell, but free.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors