title: Running Laravel's migration command on AWS Elastic Beanstalk
body: <p>I'm having a hard time deploying a Laravel app for test purposes on AWS Elastic Beanstalk. 
  Followed all sources i could find in web including AWS documentation.</p>
  
  <p>Created a Elastic Beanstalk environment and uploading an application is straightforward as long as i do not include <code>.ebextensions</code> and the <code>.yaml</code> file  in it.</p>
  
  <p>Based on <a href="https://www.youtube.com/watch?v=ISVaMijczKc&amp;t=1430s" rel="nofollow noreferrer">Maximilian's</a> tutorial i created <code>init.config</code> file inside <code>.ebextensions</code> with contents:</p>
  
  <pre><code>container_commands:
      01initdb:
          command: "php artisan migrate"
  </code></pre>
  
  <p>Environment gets to a degraded state as it finishes to update and i get the following logs:</p>
  
  <pre><code>[2018-11-20T23:14:08.485Z] INFO  [7969]  : Command processor returning results: 
  {"status":"FAILURE","api_version":"1.0","results":[{"status":"FAILURE","msg":"(TRUNCATED)...y exists\")\n/var/app/ondeck/vendor/laravel/framework/src/Illuminate/Database/Connection.php:458\n\n2   PDOStatement::execute()\n/var/app/ondeck/vendor/laravel/framework/src/Illuminate/Database/Connection.php:458\n\nPlease use the argument -v to see more details. \ncontainer_command 01initdb in .ebextensions/init.config failed. For more detail, check /var/log/eb-activity.log using console or EB CLI","returncode":1,"events":[]}],"truncated":"true"}
  </code></pre>
  
  <p>I have been trying different <code>.config</code> files from other instruction resources but none of them seems to work.</p>
  
  <p>I'm running:
  Laravel Framework 5.7.5
  EB Platform uses PHP 7.2 running on 64bit Amazon Linux/2.8.4
  RDS uses MySQL 5.6.40 </p>
  
  <p>I really do not know what is going on and would appreciate if you could give any suggestion.</p>