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

Class Leak Laravel Package

tomasvotruba/class-leak

Finds class leaks in PHP apps: detects classes unintentionally pulled into your runtime via autoloading, service container or tests. Helps trim dependencies, speed up CI, and keep boundaries clean by reporting unexpected class usage with clear, actionable output.

View on GitHub
Deep Wiki
Context7

Class Leak

Downloads total

Find leaking classes that you never use... and get rid of them.

Install

composer require tomasvotruba/class-leak --dev

Usage

Pass directories you want to check:

vendor/bin/class-leak check src

Make sure to exclude /tests directories, to keep reporting classes that are used in tests, but never used in the code-base.

Many types are excluded by default, as they're collected by framework magic, e.g. console command classes.

Exclude what you use

Do you want to skip classes of certain type?

vendor/bin/class-leak check src --skip-type="App\\Contract\\SomeInterface"

What if your classes do no implement any type?

vendor/bin/class-leak check src --skip-suffix="Controller"

Do you want to skip classes using a specific attribute?

vendor/bin/class-leak check src --skip-attribute="App\\Attribute\\AsController"

Happy coding!

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
milesj/emojibase
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