Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I use Artisan command in code Laravel?

Tags:

php

laravel-5

How can I use Artisan command line in my php caode Ex: php artisan --version to <?php echo 'version show here'; ?>.

like image 271
Faizan Avatar asked Feb 10 '16 10:02

Faizan


1 Answers

You can call Artisan command from your controller as below :

//calling of migrate install 
     Artisan::call('migrate:install');

i.e. just use

Artisan::call('Commandname');

For more info check this

like image 135
Drudge Rajen Avatar answered Sep 30 '22 03:09

Drudge Rajen