laravel-find-unused-code
laravel-find-unused-code copied to clipboard
Undefined index: Controller
Line 86:
\Log::info('Ignoring route : ' . $route->getAction()['controller']);
Throws an error: Undefined index: controller.
Fix that worked for me: Remove the $route->getAction()['controller'] and just spit out 'Ignoring route'.
Oh - do you know which route was causing the issue in your code? Was it a closure by any chance?
I got the same error. It was a closure for me.
Fixed it with:
if (empty($route->getAction()['controller']) || !str_contains($route->getAction()['controller'], 'App')) {