Where to Put the PHP Artisan Migrate Command

how can i create a php file that runs php artisan migrate command?

You can call artisan commands like this in functions or even in routes!

public function callArtisanCommands()
{
\Artisan::call('cache:clear');
\Artisan::call('view:clear');
\Artisan::call('route:clear');
\Artisan::call('migrate:fresh');
}

Where do I run php artisan make:migration posts on WIndows?

You have to go in folder where artisan is located (usally root of project) and with CMD or CONSOLE write php artisan make:migration posts

How php artisan migrate command uses Connection.php file?

After a deep research I've found the reasons why migrate command didn't work. The problem was in one of my repository's constructor which called a function that uses the column. I didn't know that Laravel somehow run source code in repositories before running migrations. And I still want to find out steps which are done by migrate command.

I'm trying to run the php artisan migrate command, but I'm not getting it. I'm getting this error

**In your php.ini configuration file simply uncomment the extension:**

;extension=php_pdo_mysql.dll

(You can find your php.ini file in the php folder where your stack server is installed.)

If you're on Windows make it: extension=php_pdo_mysql.dll

If you're on Linux make it: extension=pdo_mysql.so

And do a quick server restart.


Related Topics



Leave a reply



Submit