Skip to content

Instantly share code, notes, and snippets.

@stivncastillo
Last active September 30, 2016 14:31
Show Gist options
  • Save stivncastillo/bc2fa6f5ebea6865f25ccc946d0bb05e to your computer and use it in GitHub Desktop.
Save stivncastillo/bc2fa6f5ebea6865f25ccc946d0bb05e to your computer and use it in GitHub Desktop.
Artisan commands from url, Laravel.
<?php
Route::get('/artisan/{key?}', array('as' => 'artisan', function($key = null)
{
if($key == "down"){
try {
Artisan::call('down');
echo 'Server Down';
} catch (Exception $e) {
Response::make($e->getMessage(), 500);
}
} else {
App::abort(404);
}
}));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment