Add $sync parameter to send() method of Mail, SMS and Push classes #2402

This commit is contained in:
Kijin Sung 2025-03-08 20:50:18 +09:00
parent 7e9dd8f297
commit b6c444c536
3 changed files with 9 additions and 6 deletions

View file

@ -507,12 +507,13 @@ class SMS
/**
* Send the message.
*
* @param bool $sync
* @return bool
*/
public function send(): bool
public function send(bool $sync = false): bool
{
// If queue is enabled, send asynchronously.
if (config('queue.enabled') && !defined('RXQUEUE_CRON'))
if (!$sync && config('queue.enabled') && !defined('RXQUEUE_CRON'))
{
Queue::addTask(self::class . '::' . 'sendAsync', $this);
return true;