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
Php Code Search

Php Code Search Laravel Package

permafrost-dev/php-code-search

Search PHP projects by symbol or text to quickly find classes, methods, functions, and constants across your codebase. Fast, lightweight code search for local repositories, useful for audits, refactors, and navigating large Laravel or PHP applications.

View on GitHub
Deep Wiki
Context7

Search PHP source code for function & method calls, variables, and more from PHP.

Frequently asked questions about Php Code Search
Can I use this package to search for method calls across my entire Laravel application, including vendor dependencies?
Yes, the package scans files and directories recursively, so it will cover your entire Laravel project, including vendor folders. However, searching vendor dependencies may produce false positives due to dynamic method calls or magic methods. Filtering by namespace (e.g., `App\`) can help refine results.
How does this compare to using `grep` or `ripgrep` for code searches in Laravel?
Unlike `grep` or `ripgrep`, this package provides structured, parsed results (e.g., method calls, variables, and annotations) rather than raw text matches. It’s ideal for static analysis, refactoring tools, or building custom Laravel admin dashboards. For simple text searches, `ripgrep` may still be faster, but this package offers deeper PHP-specific insights.
Will this package work with Laravel 11 and PHP 8.2+ attributes or enums?
The package supports PHP 8.0+, so it will work with Laravel 11 and PHP 8.2 features like attributes and enums. However, Laravel-specific syntax (e.g., Facades or Service Providers) may require custom parsing logic. Check the documentation for updates or consider extending the package for full Laravel 11 support.
Can I integrate this into my Laravel CI/CD pipeline to detect deprecated methods or unused code?
Absolutely. You can configure the package to run as a pre-test hook in your `phpunit.xml` or via a custom Artisan command. For example, flag deprecated methods by comparing results against a whitelist or Laravel’s `deprecated()` annotations. Pair it with Laravel’s testing tools to fail builds on critical issues.
Does this package support searching Blade templates or only PHP files?
Currently, the package focuses on PHP source code (`.php` files) and won’t parse Blade templates by default. If you need Blade support, you’ll need to pre-process templates into PHP or extend the package to handle Blade syntax. For now, it’s best suited for searching controllers, models, and service classes.
How can I cache search results to avoid slow performance on large Laravel codebases?
Cache results using Laravel’s cache system or a dedicated storage driver (e.g., Redis). Wrap the search logic in a Laravel Service Provider and boot it during app startup to pre-load indexed data. For background processing, use Laravel Queues to run searches asynchronously, especially for codebases with 100K+ lines.
Are there any known false positives when searching for method calls, like dynamic invocations (e.g., `call_user_func`)?
Yes, static analysis may miss dynamically generated method calls (e.g., `call_user_func`, `__call()`, or magic methods). To mitigate this, combine results with runtime tools like Laravel Debugbar or Xdebug. The package’s output can also be used to generate test cases for edge cases.
Can I use this package to generate dependency graphs for Laravel packages or microservices?
Yes, the package’s structured output (JSON/CLI) makes it easy to generate dependency matrices or call graphs. Pipe results into custom scripts or tools like D3.js for visualization. For microservices, run searches per module and aggregate results to map cross-service dependencies.
Is there a Laravel-specific wrapper or Artisan command available for easier integration?
While the package itself doesn’t include Laravel-specific wrappers, you can create a custom Artisan command (e.g., `php artisan search:methods`) to simplify usage. The package’s API is designed for easy integration, so you can build Laravel-specific features like Facade resolution or event listeners for file updates.
What alternatives should I consider if I need runtime execution tracing instead of static analysis?
For runtime behavior, pair this package with tools like Xdebug, Blackfire, or Laravel’s built-in Debugbar. PHPStan or Psalm are also alternatives for static analysis, but they focus more on type checking than code search. If you need both static and dynamic insights, combine this package with a profiling tool for a comprehensive solution.
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.
anousss007/vigilance
supportpal/eloquent-model
ardenexal/fhir-models
laravel-at/laravel-image-sanitize
romalytar/yammi-audit-log-laravel
ardenexal/fhir-validation
arshaviras/weather-widget
laravel-chronicle/core
sunchayn/nimbus
daikazu/eloquent-salesforce-objects
unseen-codes/chat
romalytar/yammi-jobs-monitoring-laravel
kisame76/filament-db-table-state
nqxcode/laravel-lucene-search
dpfx/laravel-livewire-wizards
workos/workos-php-laravel
sofa/laravel-global-scope
nawasara/auth-primitives
adhocrat-io/arkhe-main
make-dev/orca-harpoon