Home » Php » laravel – php artisan migrate runs console commands

laravel – php artisan migrate runs console commands

Posted by: admin February 25, 2020 Leave a comment


PHP Artisan/Laravel question here. I have a couple command scripts in App/Console/Commands, which I basically use as scripts to execute from the cli when I wish.

Oddly, running php artisan migrate --path=/database/migrations/main seems to execute those commands. I created the commands after my schema, which is why I’m just running into the problem now. I’m running migrations on a new server for the first time, and since none of the tables exist that are called in the first command script, the migrate command chokes and says the tables don’t exist. However, I don’t want migrate to run any of these other commands when I’m trying to run migrations – that doesn’t make sense to me. I’m thinking there’s a way to stop this by updating my Kernal.php file that’s also in the Commands folder, but I’m not sure how. Assuming there’s something going on here with PHP Artisan that I don’t fully understand, but can’t seem to find an answer to. Thanks!

How to&Answers: