Created
January 19, 2020 16:46
-
-
Save alouini333/28ec4214c08887660f3a2f187db5d39e to your computer and use it in GitHub Desktop.
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
<?php | |
namespace App\Channels; | |
use Illuminate\Notifications\Channels\DatabaseChannel as IlluminateDatabaseChannel; | |
use Illuminate\Notifications\Notification; | |
class DatabaseChannel extends IlluminateDatabaseChannel | |
{ | |
/** | |
* Send the given notification. | |
* | |
* @param mixed $notifiable | |
* @param \Illuminate\Notifications\Notification $notification | |
* | |
* @return \Illuminate\Database\Eloquent\Model | |
*/ | |
public function buildPayload($notifiable, Notification $notification) | |
{ | |
return [ | |
'id' => $notification->id, | |
'type' => get_class($notification), | |
'data' => $this->getData($notifiable, $notification), | |
'read_at' => null, | |
'tenant_id' => $notification->getTenant()->id | |
]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment