Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 9 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 1 |
| SendExecutiveReport | |
0.00% |
0 / 9 |
|
0.00% |
0 / 2 |
12 | |
0.00% |
0 / 1 |
| __construct | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| handle | |
0.00% |
0 / 8 |
|
0.00% |
0 / 1 |
6 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace App\Console\Commands; |
| 4 | |
| 5 | use App\Http\Controllers\Notifications; |
| 6 | use Illuminate\Console\Command; |
| 7 | use Illuminate\Support\Facades\Log; |
| 8 | use Illuminate\Http\Request; |
| 9 | |
| 10 | class SendExecutiveReport extends Command |
| 11 | { |
| 12 | /** |
| 13 | * The name and signature of the console command. |
| 14 | * |
| 15 | * @var string |
| 16 | */ |
| 17 | protected $signature = 'send:executive-report'; |
| 18 | |
| 19 | /** |
| 20 | * The console command description. |
| 21 | * |
| 22 | * @var string |
| 23 | */ |
| 24 | protected $description = 'Send email executive report'; |
| 25 | |
| 26 | /** |
| 27 | * Create a new command instance. |
| 28 | * |
| 29 | * @return void |
| 30 | */ |
| 31 | public function __construct() |
| 32 | { |
| 33 | parent::__construct(); |
| 34 | } |
| 35 | |
| 36 | /** |
| 37 | * Execute the console command. |
| 38 | * |
| 39 | * @return int |
| 40 | */ |
| 41 | public function handle() |
| 42 | { |
| 43 | try { |
| 44 | |
| 45 | $notifications = new Notifications(); |
| 46 | |
| 47 | $r = new Request([ |
| 48 | 'processed_by' => "System", |
| 49 | 'User-ID' => 1 |
| 50 | ]); |
| 51 | |
| 52 | $notifications->send_executive($r); |
| 53 | |
| 54 | } catch (\Exception $e) { |
| 55 | Log::channel('cron_send_executive_report')->error($e->getMessage()); |
| 56 | } |
| 57 | } |
| 58 | } |