| 1234567891011121314151617181920212223 |
- <?php
- namespace App\Tasks;
- use App\Services\PushNotificationDispatcher;
- use Illuminate\Support\Facades\Log;
- use Throwable;
- class SendPushNotificationsTask
- {
- public function __construct(private PushNotificationDispatcher $dispatcher) {}
- public function __invoke(): void
- {
- try {
- $this->dispatcher->dispatch();
- } catch (Throwable $e) {
- Log::error('SendPushNotificationsTask failed: ' . $e->getMessage(), [
- 'exception' => $e,
- ]);
- }
- }
- }
|