To automate composer updates and laravel artisan commands whenever you upload updated codes to AWS elastic beanstalk, you need to configure some commands. The locations are relative to your laravel’s root folder, not server root.
Here is my configuration for composer in Beanstalk.
Make sure you uploaded “composer.phar” in laravel root, too.
commands: 01updateComposer: command: export COMPOSER_HOME=/root && /usr/bin/composer.phar self-update option_settings: - namespace: aws:elasticbeanstalk:application:environment option_name: COMPOSER_HOME value: /root container_commands: 01optimize: command: "/usr/bin/composer.phar dump-autoload --optimize"
And Artisan config
container_commands: 01migrateSeed: command: "php artisan migrate --force"
Because your “production server” won’t allow migrate without “–force” parameter!