laravel-ide-helper: Class 'Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider' not found
Hi. I’ve tried to find my mistake, but I can’t. I’ve been following the “Automatic phpDoc generation for Laravel Facades” guide, but i fails.
Running MAMP PRO with php 5.4.10.
After adding 'Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider',
to the app/config/app.php this error is appearing:
Symfony \ Component \ Debug \ Exception \ FatalErrorException Class ‘Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider’ not found in /Users/x/Sites/laravel/todo/vendor/laravel/framework/src/Illuminate/Foundation/ProviderRepository.php line 158
If I run the `php artisan ide-helper:generate`` it generates this error
`PHP Fatal error: Class ‘Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider’ not found in /Users/michaelsoerensen/Sites/laravel/todo/vendor/laravel/framework/src/Illuminate/Foundation/ProviderRepository.php on line 158 {“error”:{“type”:“Symfony\Component\Debug\Exception\FatalErrorException”,“message”:“Class ‘Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider’ not found”,“file”:“/Users/michaelsoerensen/Sites/laravel/todo/vendor/laravel/framework/src/Illuminate/Foundation/ProviderRepository.php”,“line”:158}}{“error”:{“type”:"Symfony\Component\Debug\Excep [something more I can’t see…)``
The php error log have this:
PHP Fatal error: Class 'Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider' not found in /Users/michaelsoerensen/Sites/laravel/todo/vendor/laravel/framework/src/Illuminate/Foundation/ProviderRepository.php on line 158
Any help is much much appreciated
Thanks 😃
About this issue
- Original URL
- State: closed
- Created 10 years ago
- Reactions: 1
- Comments: 15 (2 by maintainers)
Hi, I found this thread by googling “Class ‘Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class’ not found”. It was my real problem which I was unable to solve. I checked my composer.json file twice, it was ok, but error still occured. Right before uninstalling this package I decided to try to remove “::class” from provider definition in app.php. And it works!
Documentation says:
And it didn’t work for me. When I replaced it to
it works fine. And IDE recognizes all classes correctly now. I hope it helps to somebody with similar problem.
my case had APP_ENV=prod instead of APP_ENV=production
In my case was because the package was in require-dev and in my AppServiceProvider i had
if ($this->app->isLocal()) { $this->app->register(\Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class); }
And in composer.json i had
"post-update-cmd": [ "Illuminate\\Foundation\\ComposerScripts::postUpdate", "@php artisan ide-helper:generate", "@php artisan ide-helper:meta" ]
So when i run any deploy, the post-update-cmd was triggering, and raising a error
zahraMHD
Class ‘Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider’ is used to enable PHPStorm to find classes. When you have “use \Request;” in your php file, PHPStorm cannot find the source file this refers to. Google/search Laravel Ide Helper in github and you will see how ‘Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider’ can be used.
Before you try to deploy your code, comment out ‘Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider’ in composer.json.
Hope this helps
Paul
From: zahraMHD [mailto:notifications@github.com] Sent: June-08-16 6:28 PM To: barryvdh/laravel-ide-helper Cc: Paul Neal; Comment Subject: Re: [barryvdh/laravel-ide-helper] Class ‘Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider’ not found (#55)
I have this problem I update my composer.json and add Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class, in my app.php in providers array but when run php artisan ide-helper:generate command I got this error " Class ‘Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider’ not found " is any thing that I did not check?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/barryvdh/laravel-ide-helper/issues/55#issuecomment-224749436 , or mute the thread https://github.com/notifications/unsubscribe/AJApOE4dEwz0uRTmd8YS1IUn2cuwitV7ks5qJ0HVgaJpZM4Be-Y_ . https://github.com/notifications/beacon/AJApOLHak1Jl_LBwyg7gx25HdwsS7Frhks5qJ0HVgaJpZM4Be-Y_.gif