Closed nunomira closed 8 years ago
Try adding the service provider to app.php after installing the package. I think Laravel under the hood runs clear-compiled.
Hi, thanks.
I have added it:
Mpociot\LaravelTestFactoryHelper\TestFactoryHelperServiceProvider::class,
If I remove it, a different error is received:
[Symfony\Component\Console\Exception\CommandNotFoundException]
There are no commands defined in the "test-factory-helper" namespace.
Of course the command won't work if you don't include the provider.
Try this if you haven't already.
Comment out or remove the provider from the app.php file Composer update to pull down the package Add the provider to app.php Run composer dumpautoload -o just to be sure.
No luck... All the same. I have even tried to do it from within homestead (homestead ssh, just to eliminate a windows problem) but the result is the same.
Maybe you still have it somewhere else?
I can confirm the package works great. I installed it on a few projects already.
Try deleting manually the vendor folder and the composer.lock file and run a clean composer install.
Don't know what happened to my last answer... but it wasn't submitted after all.
I tried that as well - thanks - no luck. I even tried a new project - all the same. But it seems like I'm the only one having this problem. Really frustrating! I was really curious about this :)
This is surreal... I tried it on an existing project and it installed without issues!
And now on another new project it installed as well.
@nunomira I'm having the exact same issue! Installed it yesterday at home and it worked. Pushed my changes, pulled them today on another machine: Won't work. Tried everything, can't tell why it fails.
@ionut-tanasa Can you show me your composer.json? I made some adjustments to mine, maybe that's the problem.
@LukasMa have you tried running composer update
after pulling the changes?
These issues are not related to the package itself, but seem to be an installation issue.
Autoloader is trying to load this file
...../vendor/mpociot/laravel-test-factory-helper/src/Mpociot/LaravelTestFactoryHelper/TestFactoryHelperServiceProvider.php
but the real location is
.../vendor/mpociot/laravel-test-factory-helper/src/TestFactoryHelperServiceProvider.php
I've just stepped through the code and the ClassLoader is failing to locate the file, line 381.
Update Mpociot\LaravelTestFactoryHelper\composer.json from
"autoload": {
"psr-0": {
"Mpociot\\LaravelTestFactoryHelper": "src/"
}
}
to
"autoload": {
"psr-0": {
"": "src/"
}
}
and
php artisan clear-compiled
works fine.
Fixed with the latest release
I have tried to install this package (on a fresh Laravel 5.2.27 installation) using composer require, but I get an error:
the same happens when I run
php artisan test-factory-helper:generate