Skip to content

Instantly share code, notes, and snippets.

@juyal-ahmed
Last active April 17, 2019 08:04
Show Gist options
  • Save juyal-ahmed/47a04805bca39237ba087a30fe763575 to your computer and use it in GitHub Desktop.
Save juyal-ahmed/47a04805bca39237ba087a30fe763575 to your computer and use it in GitHub Desktop.
Laravel fire an Artisan command from an HTTP route by using Artisan facade
<?php
Route::get('/foo', function()
{
$exitCode = Artisan::call('command:name', ['--option' => 'foo']);
//
});
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment