Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Psysh Laravel Package

psy/psysh

PsySH is an interactive PHP REPL, runtime developer console, and debugger. Explore code, inspect variables, and run commands in a powerful shell with history, configuration, themes, and integrations—ideal for fast debugging and experimentation.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Developer Productivity: Accelerate debugging, prototyping, and exploration of PHP/Laravel applications by providing an interactive REPL (Read-Eval-Print Loop) with autocompletion, syntax highlighting, and runtime inspection.
  • Build vs. Buy: Buy—PsySH is a mature, open-source solution with no licensing costs, reducing the need to build an in-house REPL tool. Avoid reinventing the wheel for developer tooling.
  • Laravel Ecosystem Integration: Replace or augment Laravel Tinker (which is built on PsySH) for a more feature-rich debugging experience, especially for teams using Laravel.
  • Onboarding & Education: Use PsySH to onboard new developers by providing an interactive sandbox for exploring application logic, database queries, and service layers.
  • Debugging Complex Workflows: Enable developers to test edge cases, validate assumptions, and debug issues in real-time without restarting the application or writing temporary scripts.
  • Feature Development: Use hot code reloading (with uopz) to iterate on logic, APIs, or business rules without manual restarts, speeding up development cycles.
  • Security & Compliance: Leverage Restricted Mode to mitigate risks in shared or untrusted environments (e.g., CI/CD pipelines, developer machines with multiple projects).
  • Custom CLI Tools: Embed PsySH in internal tools (e.g., data migration scripts, report generators) to provide an interactive layer for parameter tuning or ad-hoc queries.

When to Consider This Package

  • Avoid if:

    • Your team primarily uses non-PHP backends (e.g., Node.js, Python, Go) and needs a language-agnostic REPL.
    • You require enterprise-grade support (e.g., SLAs, dedicated maintenance) and are unwilling to manage open-source dependencies.
    • Your application is PHP 5.3 or older (PsySH requires PHP 7.4+ for full features).
    • You need static analysis tools (e.g., IDE integration for refactoring) instead of runtime exploration.
    • Security is a critical concern in shared environments without strict configuration controls (e.g., trustProject: never must be enforced).
  • Consider if:

    • Your stack is PHP/Laravel/Symfony and developers spend significant time debugging or exploring code.
    • You want to reduce context-switching between IDEs, CLI, and browsers during development.
    • Your team uses TDD/BDD and needs a REPL for quick assertions or mock interactions.
    • You’re building internal developer tools (e.g., admin panels, data tools) that could benefit from embedded interactivity.
    • You need advanced features like:
      • Hot code reloading (with uopz) for rapid iteration.
      • Syntax-aware autocompletion (e.g., $user-> → methods/properties of the actual object).
      • Clipboard integration for copying results or code snippets.
      • Custom themes/configurations for team consistency.
  • Alternatives to Evaluate:

    • Laravel Tinker: Lighter but lacks some PsySH features (e.g., experimental readline, hot reloading).
    • PHP’s Built-in REPL: Basic but clunky (no autocompletion, poor UX).
    • Custom Scripts: For one-off tasks, but PsySH is better for iterative workflows.
    • VS Code PHP Debug Extension: If your team prefers IDE-based debugging over CLI tools.

How to Pitch It (Stakeholders)

For Executives (Business/Tech Leads)

"PsySH is a developer superpower that cuts debugging time by 30–50% for our PHP/Laravel teams. It’s like an interactive shell for PHP—think of it as a REPL for Laravel, but 10x more capable than Laravel Tinker. Here’s why it’s worth adopting:

  • Faster Iteration: Developers can test logic changes instantly (hot reloading skips restarts), accelerating feature development.
  • Reduced Toil: No more writing temporary scripts or restarting containers to debug edge cases. PsySH lets them explore live data, validate assumptions, and fix issues in the flow of work.
  • Onboarding Boost: New hires can self-serve answers to ‘how does this work?’ by diving into the codebase interactively, reducing ramp-up time.
  • Security: We can enforce Restricted Mode to prevent malicious config poisoning in shared environments (e.g., CI/CD).
  • Cost-Effective: It’s free, open-source, and maintained by the community—no vendor lock-in or licensing fees. Teams at [Company X] use it to debug payment flows, validate API responses, and prototype business logic without leaving their terminal. For a team of 5+ PHP developers, the ROI is clear: less context-switching, fewer bugs, and faster releases."

For Engineering (Devs/Architects)

"PsySH is the Swiss Army knife for PHP debugging. Here’s how it levels up your workflow:

  • Autocomplete on Steroids: Type $user-> and see only the methods/properties of that object (not the whole class). Works with type hints, generics, and inheritance.
  • Hot Reloading: Edit a function in app/Services/UserService.php, switch back to PsySH, and your changes are live—no php artisan serve restart. (Requires uopz extension.)
  • Clipboard & History: Copy results (copy $_) or search history with Ctrl+R (like Bash). Paste multi-line code without execution.
  • Customizable: Theme it, tweak config (e.g., semicolonsSuppressReturn), or embed it in your CLI tools.
  • Safe by Default: New Restricted Mode blocks untrusted project configs unless explicitly allowed (mitigates CVE-2026-25129). Example use cases:
  • Debugging a complex Eloquent query? Dump the query builder object and inspect it interactively.
  • Prototyping a new API endpoint? Test routes, validate responses, and tweak logic without writing a full test.
  • Teaching a junior dev how the auth system works? Let them explore the Auth facade live. It’s Laravel Tinker on steroids—and it works outside Laravel too."

For Security/Compliance

"PsySH includes critical security controls for shared environments:

  • Restricted Mode: Blocks execution of untrusted .psysh.php configs or local binaries by default. Requires explicit trustProject (prompt/always/never).
  • CVE-2026-25129 Fix: Patched in v0.12.19/v0.11.23 to prevent CWD configuration poisoning.
  • Audit Trail: All trust decisions are logged in trusted_projects.json, enabling compliance reviews. Recommendation: Configure trustProject: never in CI/CD pipelines and prompt for developer machines to balance usability and security."*
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope
anil/file-picker
broqit/fields-ai