Last active
September 30, 2016 14:31
-
-
Save stivncastillo/bc2fa6f5ebea6865f25ccc946d0bb05e to your computer and use it in GitHub Desktop.
Artisan commands from url, Laravel.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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