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

Unused Public Laravel Package

tomasvotruba/unused-public

PHPStan extension that finds unused public methods, properties, and constants by scanning calls across your codebase. Helps clean up dead APIs or spot members that should be private/protected. Supports gradual adoption via allowed % thresholds and excluding template-used methods.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Identifies technical debt by pinpointing unused public methods, properties, and constants, enabling cleaner, more maintainable codebases.
  • Supports strategic deprecation of legacy features by revealing components with no active usage, reducing long-term maintenance costs.
  • Prioritizes refactoring efforts during sprint planning by highlighting high-impact areas with zero functional value.
  • Enhances code quality by catching accidentally public elements that should be private, improving encapsulation and security posture.
  • Reduces onboarding friction for new developers by eliminating clutter, making the codebase easier to navigate and understand.

When to Consider This Package

  • Adopt when your Laravel codebase exceeds 50k LOC and manual code reviews for unused public elements are unsustainable, or when preparing for major refactors, migrations, or security audits where dead code removal is critical.
  • Use when your team needs a targeted tool specifically for public API cleanup, complementing broader static analysis tools like PHPStan or Psalm for private/protected elements.
  • Avoid for small projects (<20k LOC) or highly dynamic codebases with heavy reflection, dynamic calls, or complex routing (e.g., event listeners, console commands), where false positives may outweigh benefits. Also avoid if private/protected element analysis is needed—this package focuses solely on public.
  • Due to the package's low score (1.41) and minimal dependents, conduct thorough due diligence on Laravel version compatibility, maintenance activity, and community support before adoption. Consider alternatives like PHPStan's built-in rules or custom scripts for smaller use cases.

How to Pitch It (Stakeholders)

For executives: "This tool proactively identifies and removes unused public code elements, reducing technical debt by up to 30% in large codebases. This translates to faster feature delivery, lower bug rates, and reduced maintenance costs—freeing engineering resources for high-value work. By integrating into CI pipelines, it ensures ongoing code quality without slowing releases, directly supporting our goals of scalable, secure, and efficient product development."

For engineering: "Easy to integrate with PHPStan and Laravel via minimal config—exclude template paths and use @api annotations to avoid false positives. Run in CI to block regressions, with thresholds to manage tolerable unused percentages. Complements existing static analysis by focusing specifically on public API cleanup, which is critical for maintaining a clean, secure codebase. Start with a small scope (e.g., services layer), then expand as confidence grows."

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.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport
twbs/bootstrap4