"Class 'auth' not found" error when running ide-helper:meta
ignas2526 opened this issue · 3 comments
Versions:
- ide-helper Version: 2.13.0
- Laravel Version: 9.52.15
- PHP Version: 8.1.20
Description:
When running php artisan ide-helper:meta
I get:
Class 'auth' not found.
at vendor/barryvdh/laravel-ide-helper/src/Console/MetaCommand.php:158
154▕ */
155▕ protected function registerClassAutoloadExceptions(): callable
156▕ {
157▕ $autoloader = function ($class) {
➜ 158▕ throw new \ReflectionException("Class '$class' not found.");
159▕ };
160▕ spl_autoload_register($autoloader);
161▕ return $autoloader;
162▕ }
Any thoughts on what could be the issue?
When I run the following code in the php artisan tinker
, it works:
app()->make('auth')
> Illuminate\Auth\AuthManager {#532}
The codebase was just upgraded to Laravel 9 from 8. On Laravel 8, all ide-helper commands were working fine.
The php artisan ide-helper:eloquent
, php artisan ide-helper:generate
and php artisan ide-helper:models
seem to work fine.
What's the full stacktrace?
I've often found that stray config/*.php files interrupt / interfere with the Container loading -- and results in this difficult to diagnose message.
Try running "php artisan tinker" -- it will most likely fail, but it make it easier to identify where the failure stems from.
I encounter these especially after upgrades - changes to config files (missing .env entries, or changed config templates)
$.02
No feedback-> closing