update v1.0.7.9 R.C.
This is a Release Candidate. We are still testing.
This commit is contained in:
56
app/Console/Commands/SendReport.php
Normal file
56
app/Console/Commands/SendReport.php
Normal file
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
use App\Http\Controllers\Agent\helpdesk\NotificationController;
|
||||
use App\Http\Controllers\Common\PhpMailController;
|
||||
use Exception;
|
||||
|
||||
class SendReport extends Command {
|
||||
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'report:send';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Sending the report mail ';
|
||||
protected $report;
|
||||
protected $mail;
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct() {
|
||||
$mail = new PhpMailController();
|
||||
$report = new NotificationController($mail);
|
||||
$this->report = $report;
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle() {
|
||||
try {
|
||||
$this->report->send_notification();
|
||||
\Log::info("Report has send");
|
||||
$this->info("Report has send");
|
||||
} catch (Exception $ex) {
|
||||
dd($ex);
|
||||
$this->error($ex->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user