create a php file and run the code.
<?php
exec("php artisan migrate");
something like that.
or if that hangs try
exec("php artisan migrate > /dev/null &");
you would need to place this script in a public folder in order to run and make sure to set the path to artisan.
you can also look into this. https://github.com/JN-Jones/web-artisan
It is a web based script that says it will let you run artisan commands.
I've created a file named artisan.php in my public directory and I added the following code in it
<?php
echo '<br>init with app tables migrations...';
Artisan::call('migrate', ['--path'=> "app/database/migrations"]);
echo '<br>done with app tables migrations';
It gives me the following error when try to visit http://larabook.mburakergenc.com/artisan.php
init with app tables migrations...
Fatal error: Class 'Artisan' not found in /home/brinddea/public_html/larabook/artisan.php on line 3
For the web script, I installed it but I have no idea about how to use it. Just browsed on google and couldn't find an example.
php artisan is php file without .php ,
so i think if you can run it some how you can do migrate
I actually solved it by creating a new controller.
Here is how did it;
Route::get('migrate', function() {
echo '<br>init with Migrate tables ...';
Artisan::call('migrate', ['--quiet' => true, '--force' => true]);
echo '<br>done with Migrate tables';
});
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community