Have you ran composer update ?
and try
composer dump-autoload
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
So i am using a deploy system that basically runs 'composer install --no-dev' on my production box. But then right afterwards it tries to run 'php artisan optimize' and 'php artisan migrate' and its not working (note: about the latter, i heard laravel 5.6 got rid of artisan's optimize but I'm running 5.5). I logged into box and tried running a 'php artisan list' and realized no artisan command works.
I see this error:
2018-03-22 12:52:16] staging.ERROR: Class 'Way\Generators\GeneratorsServiceProvider' not found {"exception":"[object] (Symfony\Component\Debug\Exception\FatalThrowableError(code: 0): Class 'Way\Generators\GeneratorsServiceProvider' not found at /var/www/my_app/releases/1/vendor/laravel/framework/src/Illuminate/Foundation/ProviderRepository.php:208)
if i make the deploy system do a 'composer install' without the --no-dev option so it includes my dev dependencies, then 'php artisan' suddenly works. Any idea why?
Here is my app's composer.json file:
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=5.6.4",
"barryvdh/laravel-debugbar": "^2.4",
"brozot/laravel-fcm": "^1.2",
"chumper/zipper": "^1.0",
"davejamesmiller/laravel-breadcrumbs": "3.*.*",
"firebase/php-jwt": "^5.0",
"guzzlehttp/guzzle": "~5.3|~6.0",
"hmazter/laravel-schedule-list": "^0.2.0",
"laravel/framework": "5.*.*",
"laravel/tinker": "~1.0",
"laravelcollective/html": "~5.0",
"maatwebsite/excel": "~2.1.0",
"nesbot/carbon": "^1.22",
"pendonl/laravel-schedulelogger": "^1.1",
"spatie/laravel-activitylog": "^2.0",
"webpatser/laravel-uuid": "2.0"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"krlove/eloquent-model-generator": "^1.2",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~5.7",
"xethron/migrations-generator": "^2.0",
"orangehill/iseed": "dev-master"
},
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\": "app/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\": "tests/"
}
},
"scripts": {
"post-root-package-install": [
"php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"php artisan key:generate"
]
},
"config": {
"preferred-install": "dist",
"sort-packages": true
}
}
Here is some info from that box:
$ php -v PHP 7.1.3 (cli) (built: Apr 13 2017 18:45:36) ( NTS ) Copyright (c) 1997-2017 The PHP Group Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
$ composer -V Composer version 1.5.2 2017-09-11 16:59:25
Pretty sure I am on laravel 5.5 since i see in /var/www/my_app/releases/1/vendor/laravel/framework/composer.json :
...
"extra": {
"branch-alias": {
"dev-master": "5.5-dev"
}
},
Thanks for any ideas, Ari
PS I'm using a Capistrano-like deploy system called Deployer.org (more php-based than ruby-based). I don't think its doing anything funky, I can see the exact composer default options (which is a tiny bit more complicated than the 'composer install --no-dev' i posted earlier):
composer install --verbose --prefer-dist --no-progress --no-interaction --optimize-autoloader --no-dev
Note: also asked this on laravel.io but seems like more active here (i'll delete that thread over weekend if get an answer here)
In your require-dev, you have xethron/migrations-generator. That package (one of its subpackages) uses Way\Generators\GeneratorsServiceProvider.
I'm assuming that you're using that migrations-generator somewhere in your production code, which means you need the package in the require section.
Please or to participate in this conversation.