users worden nu beter geresolved
This commit is contained in:
@@ -2,8 +2,6 @@
|
||||
|
||||
namespace App\Notifications;
|
||||
|
||||
use App\Models\Chat;
|
||||
use App\Models\Message;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Notifications\Notification;
|
||||
use NotificationChannels\WebPush\WebPushChannel;
|
||||
@@ -13,47 +11,28 @@ class NewActivityNotification extends Notification
|
||||
{
|
||||
use Queueable;
|
||||
|
||||
public $activity;
|
||||
public array $activity;
|
||||
|
||||
/**
|
||||
* Create a new notification instance.
|
||||
*/
|
||||
public function __construct($activity)
|
||||
public function __construct(array $activity)
|
||||
{
|
||||
$this->activity = $activity;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the notification's delivery channels.
|
||||
*
|
||||
* @return array<int, string>
|
||||
*/
|
||||
public function via(object $notifiable): array
|
||||
{
|
||||
return ['database', WebPushChannel::class];
|
||||
return [WebPushChannel::class, 'database'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the web push representation of the notification.
|
||||
*/
|
||||
public function toWebPush(object $notifiable): WebPushMessage
|
||||
{
|
||||
|
||||
$result = (new WebPushMessage)
|
||||
return (new WebPushMessage)
|
||||
->title('New Activity')
|
||||
->icon('/apple-touch-icon.png')
|
||||
->body($this->activity['content'])
|
||||
->action('View', 'view')
|
||||
->data(['url' => $this->activity['url']]);
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the array representation of the notification.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function toArray(object $notifiable): array
|
||||
{
|
||||
return [
|
||||
|
||||
Reference in New Issue
Block a user