# Unused Global Middleware Analyzer
|Category||Severity||Time To Fix|
|🚀 Performance||Minor||5 minutes|
Laravel has almost everything built-in. But sometimes, we fall into the trap of just using the Laravel skeleton code rather than cleaning it up for your specific application.
This analyzer checks to see if there are any "unused" global middleware classes lying around in your
App\Http\Kernel class. The boilerplate middleware classes it checks includes:
- HandleCors: If your application does not use CORS (your
cors.pathsconfiguration is an empty array), then this middleware is flagged as unused.
- TrustProxies: If your application does not configure trusted proxies (using the
trustedproxy.proxiesconfiguration), then this middleware is flagged as unused.
- TrustHosts: If your application does not use setup trusted proxies, then you do not need to setup trusted hosts either and this middleware is flagged as unused.
# How To Fix
To fix this issue, simply remove all the unused global middleware from your