I have a route that is essentially a "hook" to run an Artisan command, it accepts some get
parameters as arguments:
Route::get('hook', function()
{
$param = Input::get('param');
Artisan::call('myCommand', array('param' => $param));
}
myCommand
simply creates a directory in the root called param
and a hello.txt
file.
I can run myCommand
fine using php artisan myCommand param1
and it works as expected. I can also use Artisan's tinker
command and run Artisan::call()
perfectly fine too.
However when I try the command via visiting the URL (e.g. example.com/hook¶m=hello
), my command does not create anything as expected. If it helps as well, I'm trying this on Laravel Forge. On my local dev machine everything works fine.
Any idea what is wrong?