diff --git a/app/Console/Commands/ScheduledMessageDelivery.php b/app/Console/Commands/ScheduledMessageDelivery.php index 5e1034e..140b1c8 100644 --- a/app/Console/Commands/ScheduledMessageDelivery.php +++ b/app/Console/Commands/ScheduledMessageDelivery.php @@ -2,6 +2,7 @@ namespace App\Console\Commands; +use App\Events\SendAnnouncement; use App\Models\AdminNotice; use App\Models\ParkingCamera; use App\Services\AdminNoticeService; @@ -72,9 +73,21 @@ class ScheduledMessageDelivery extends Command ); } } + $this->notionCount(); DB::commit(); } catch (Exception $e) { DB::rollBack(); } } + + private function notionCount() + { + $where = [ + 'is_read' => 0 + ]; + $data = [ + 'count' => AdminNotice::query()->where($where)->count() + ]; + event(new SendAnnouncement(__('admin.succeeded'), $data, 2)); + } }