Created
May 18, 2017 14:50
-
-
Save AlexNodex/c22085c137b4a8b84e580db298ac4656 to your computer and use it in GitHub Desktop.
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
$event = $container->get('event'); | |
$event->on('cli.commands',function($console){ | |
// you can now bind a route to the console // | |
$console->command('users:add',function($arguments) { | |
//$arguments come from the command line like this... | |
// php run users:add --username="cannap" --password="dp" | |
// $arguments['username']=cannap; | |
// $arguments['password']="dp"; | |
$users = $this->get('users'); // get a pre registered service container class under users | |
return $users->addUser($arguments); | |
}; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment