Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 8 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
| SendExecutiveReport | |
0.00% |
0 / 8 |
|
0.00% |
0 / 1 |
6 | |
0.00% |
0 / 1 |
| 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\Http\Request; |
| 8 | use Illuminate\Support\Facades\Log; |
| 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 | * Execute the console command. |
| 28 | */ |
| 29 | public function handle(): void |
| 30 | { |
| 31 | try { |
| 32 | |
| 33 | $notifications = new Notifications; |
| 34 | |
| 35 | $r = new Request([ |
| 36 | 'processed_by' => 'System', |
| 37 | 'User-ID' => 1, |
| 38 | ]); |
| 39 | |
| 40 | $notifications->send_executive($r); |
| 41 | |
| 42 | } catch (\Exception $e) { |
| 43 | Log::channel('cron_send_executive_report')->error($e->getMessage()); |
| 44 | } |
| 45 | |
| 46 | } |
| 47 | } |