provision Homestead to automatically migrate tables

Viewed 228

Is there a way to use after.sh to run php artisan migrate?

I tried this:

#!/bin/bash
cd exercise-8
vagrant ssh
php artisan migrate

I realized a few things

  • you have to vagrant ssh before you do migrations
  • the bash script runs from /home/vagrant
  • vagrant ssh returns /tmp/vagrant-shell: line 3: vagrant: command not found
  • php artisan returns

    ==> default:
    ==> default: [PDOException]
    ==> default: SQLSTATE[HY000] [1045] Access denied for user 'forge'@'localhost' (using password: NO)
    ==> default:

1 Answers
Related