title: How do I perform Laravel Artisan migrations on AWS Elastic Beanstalk?
body: <p>I have a Laravel installation and have set up three environments with their own corresponding config directories:</p>
  
  <ul>
  <li>local</li>
  <li>staging</li>
  <li>production</li>
  </ul>
  
  <p>I use <code>php artisan migrate:make create_users_table</code> etc as described <a href="http://laravel.com/docs/migrations" rel="noreferrer">here</a> to create database migrations.</p>
  
  <p>In my local environment I use Vagrant and a simple MySQL server setup, and on staging &amp; production I use AWS RDS.</p>
  
  <p>To configure database access for the <strong>staging</strong> <a href="http://laravel.com/docs/configuration" rel="noreferrer">environment</a> I have a <code>app/config/staging/database.php</code> file with settings like this:</p>
  
  <pre><code>...
  "mysql" =&gt; array(
      "driver" =&gt; "mysql",
      "host" =&gt; $_SERVER["RDS_HOSTNAME"],
      "database" =&gt; $_SERVER["RDS_DB_NAME"],
      "username" =&gt; $_SERVER["RDS_USERNAME"],
      "password" =&gt; $_SERVER["RDS_PASSWORD"],
      "charset" =&gt; "utf8",
      "collaction" =&gt; "utf8_unicode_ci",
      "prefix" =&gt; "",
  ),
  ...
  </code></pre>
  
  <p>I use git to deploy the app with <code>git aws.push</code> as described <a href="http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_PHP.html" rel="noreferrer">here</a>.</p>
  
  <p>The question is: How do I run the migration on my staging (and later production) EBS server when deploying?</p>