-
Notifications
You must be signed in to change notification settings - Fork 11k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'allowBroadcastingNotificationNow' of https://github.com…
…/themsaid/framework into themsaid-allowBroadcastingNotificationNow
- Loading branch information
Showing
4 changed files
with
103 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
src/Illuminate/Notifications/Messages/BroadcastMessage.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<?php | ||
|
||
namespace Illuminate\Notifications\Messages; | ||
|
||
class BroadcastMessage | ||
{ | ||
/** | ||
* The data for the notification. | ||
* | ||
* @var array | ||
*/ | ||
public $data; | ||
|
||
/** | ||
* Determine if the message should be broadcasted immediately. | ||
* | ||
* @var array | ||
*/ | ||
public $broadcastNow = false; | ||
|
||
/** | ||
* Create a new message instance. | ||
* | ||
* @param string $content | ||
* @return void | ||
*/ | ||
public function __construct(array $data) | ||
{ | ||
$this->data = $data; | ||
} | ||
|
||
/** | ||
* Set the message data. | ||
* | ||
* @param array $data | ||
* @return $this | ||
*/ | ||
public function data($data) | ||
{ | ||
$this->data = $data; | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* Broadcast this message immediately. | ||
* | ||
* @return $this | ||
*/ | ||
public function now() | ||
{ | ||
$this->broadcastNow = true; | ||
|
||
return $this; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters