<?php
namespace App\Console\Commands;
use App\DripEmailer;
use App\User;
use Illuminate\Console\Command;
class SendEmails extends Command
{
/
* Имя и сигнатура консольной команды.
*
* @var string
*/
protected $signature = 'email:send {user}';
/ * Описание консольной команды.
*
* @var string
*/
protected $description = 'Send drip e-mails to a user';
/
* Служба "капельных" e-mail сообщений.
*
* @var DripEmailer
*/
protected $drip;
/ * Создание нового экземпляра команды.
*
*
@param DripEmailer $drip
*
@return void
*/
public function __construct(DripEmailer $drip)
{
parent::__construct();
$this->drip = $drip;
}
/**
* Выполнение консольной команды.
*
*
@return mixed
*/
public function handle()
{
$this->drip->send(User::find($this->argument('user')));
}
}