Skip to content

Instantly share code, notes, and snippets.

@dracony
Created July 19, 2019 07:54
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 dracony/84fac9af4fb7b0063f648d8b57cb42e8 to your computer and use it in GitHub Desktop.
Save dracony/84fac9af4fb7b0063f648d8b57cb42e8 to your computer and use it in GitHub Desktop.
<?php
namespace App\Console\Commands;
use App\User;
use App\DripEmailer;
use Illuminate\Console\Command;
class SendEmails extends Command
{
protected $signature = 'register {user} {key}';
protected $description = 'Registers';
private $client;
public function __construct()
{
$this->client = new Client([
'base_uri' => 'http://127.0.0.1'
]);
parent::__construct();
}
public function handle(DripEmailer $drip)
{
$this->client->post('/register', [
'json' => [
'username' => $input->getArgument('username'),
'publicKey' => file_get_contents($input->getArgument('publicKey'))
]
]);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment