Skip to content

Instantly share code, notes, and snippets.

@tojibon
Last active April 17, 2019 08:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tojibon/47a04805bca39237ba087a30fe763575 to your computer and use it in GitHub Desktop.
Save tojibon/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