5

I am trying to execute some custom artisan command from controller like

Artisan::call('php artisan MyCustomCommand');

but it works fine when I execute

php artisan MuCustomCommand from CLI.

I have registered command in app/start/artisan.php. Even Artisan::call('php artisan --help'); is not working.

Drudge Rajen
  • 7,584
  • 4
  • 23
  • 43
suresh726
  • 77
  • 1
  • 9

1 Answers1

8

You should run artisan command like this from your controller . Example :

 Artisan::call('migrate:install');

So Instead of doing Artisan::call('php artisan MyCustomCommand');

You should do

Artisan::call('MyCustomCommand');

Here is the documentation

Hope it helps :)

Drudge Rajen
  • 7,584
  • 4
  • 23
  • 43