laravie/parser
Laravie Parser is a PHP source-code parsing library for Laravel applications. It offers a simple API for tokenizing and traversing code, inspecting classes, methods, and syntax trees, and integrating static analysis or code-generation tools into your projects.
nikic/php-parser; suitable when the product needs structured class/member metadata quickly rather than a full static-analysis engine.Consider it when:
nikic/php-parser and are comfortable falling back to the underlying AST for advanced cases.Look elsewhere when:
nikic/php-parser with a dedicated architecture.For executives: This is a low-cost, MIT-licensed accelerator for developer tooling and code-generation features. It lets us inspect Laravel/PHP source safely without loading it, which can speed up internal tooling and reduce custom parser work. It should be treated as an enabling dependency, not core infrastructure, and validated with a short spike before broader adoption.
For engineering: It provides a Laravel-friendly API over the mature nikic/php-parser for reading namespaces, imports, classes, methods, properties, and parameters without autoloading. That makes it useful for generators, discovery, documentation, and lightweight analysis. The trade-off is that it is a thin wrapper with modest adoption signals, so we should pin versions, keep a direct php-parser fallback path for advanced AST work, and avoid relying on it for deep static analysis.
How can I help you explore Laravel packages today?