| 1234567891011121314151617 |
- <?php
- namespace App\Console\Commands;
- use App\Services\SiteMessageService;
- use Illuminate\Console\Command;
- class DispatchSiteMessages extends Command
- {
- protected $signature = 'messages:dispatch';
- protected $description = 'Deliver due internal messages to snapshotted recipients using their saved languages';
- public function handle(SiteMessageService $service): int
- {
- $result = $service->dispatchDue(); $this->line(json_encode($result, JSON_UNESCAPED_UNICODE));
- return $result['failed'] > 0 ? self::FAILURE : self::SUCCESS;
- }
- }
|