Questions tagged [laravel-notification]

Laravel provides support for sending notifications across a variety of delivery channels, including mail, SMS (via Nexmo), and Slack. These notifications are informational messages that notify users of something that occurred in your application.

143 questions
4
votes
2 answers

Laravel Broadcast notification - Error "array_key_exists()" when try to send notification

I'm trying to send broadcast notification to users when data changes. But every time I try to send a notification, I get this error: array_key_exists(): The first argument should be either a string or an integer. Here is my notification: class…
4
votes
1 answer

Laravel Notifications - delay email sending and cancel if condition met

I have an app where I am sending a push notification which is fine if the user is logged into the application - however, if they're not / if they have not read the notification within X minutes I'd like to send them an email. The way I am going…
Chris
  • 1,939
  • 1
  • 19
  • 38
4
votes
2 answers

Laravel 5.5 - Notifications are not being queued?

I have the following notification class: use Illuminate\Bus\Queueable; use Illuminate\Notifications\Notification; use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Notifications\Messages\MailMessage; class ConfirmEmailNotification extends…
adam78
  • 9,668
  • 24
  • 96
  • 207
4
votes
3 answers

Laravel: How to modify notifications collection

I've got a function which returns database notifications of a user (the User model is Notifiable): return $user->notifications()->get(); The result returned is like this: [ { "id": "5d6548d3-1f9b-4da5-b332-afbf428df775", "type":…
B Faley
  • 17,120
  • 43
  • 133
  • 223
4
votes
1 answer

How to use multiple slack webhook for laravel notifications

I am trying to send slack messages through laravel notification. when events such as signed up, leave , and etc. happen using different channels. But there's a problem here, because Laravel only supports one Hook URI or I just do not know how to set…
Hax0r
  • 1,722
  • 4
  • 25
  • 43
4
votes
1 answer

In Laravel, Where I should fire events and emails in repo or in controller?

I am using repository pattern in develop an application using laravel, my question is where I have to write code for fire events, send email or send an notification? and why?
4
votes
4 answers

Laravel - One notification for all users

I have social netwrok website using laravel. My notification system works well when the notification is set for a specific user. But suppose that a user became moderator and I want to notify all users of that event Is there a way to do so without…
Mody Sharf
  • 43
  • 1
  • 1
  • 4
3
votes
1 answer

Laravel Notification - via specified by user

How can the method via in a notification class can be dinamic by the users preferences, one user maybe want to receive via email, the other one, dont public function via($notifiable) { return ['database', 'broadcast', 'mail']; }
SpaceDogCS
  • 2,808
  • 3
  • 20
  • 49
3
votes
2 answers

No notifications are returned

I am trying to get user's unread notifications though my controller. This works: public function notifications(){ return \App\User::find(auth()->user()->id)->unreadNotifications()->limit(5)->get(); } This doesn't, it returns an empty…
Librasulus
  • 138
  • 1
  • 9
3
votes
0 answers

Could not be authenticated to private-App - Laravel Notification, Laravel Echo, Socket

I'm using Laravel Echo Server with Socket.io. Also I want to use Laravel Notifications for the Real Time Notifications. Below is my bootstrap.js import Echo from 'laravel-echo' window.io = require('socket.io-client'); window.Echo = new Echo({ …
Siddharth
  • 1,649
  • 4
  • 22
  • 47
3
votes
2 answers

Use Laravel Notification for Email Verification

You can send notifications via email like this in Laravel... invoice->id); return (new MailMessage) ->greeting('Hello!') ->line('One of your…
Sina Miandashti
  • 2,087
  • 1
  • 26
  • 40
2
votes
0 answers

Sending a geric notification in Laravel without a notifiable

Normally when sending notifications in Laravel you send to a class with a Notifiable trait that defines "who" the notification is going to by the instance of the class. Such as with the User model. I have a use case to send a notification to myself…
James4645
  • 105
  • 6
2
votes
1 answer

Vue.js component not updating after notification is received via websocket in Laravel

I am trying to populate the notification list on real-time but view vue component is not updating. My code so far: app.js require('./bootstrap'); window.Vue = require('vue'); Vue.component('notification-alert',…
MAY
  • 667
  • 1
  • 6
  • 21
2
votes
1 answer

Laravel Notification asserting the data passed down to mail markdown view

I am working on a Laravel project. I am writing integration/ feature tests for my application. I am now writing a test where I need to assert the data passed to the email notification and the data passed to its view. I found this link to do it,…
2
votes
1 answer

Laravel markdown mail - multiple templates. How to define path for @component('mail::*')

As detailed in config/mail.php, the default markdown mail folder is in views/vendor/mail 'markdown' => [ 'theme' => 'default', 'paths' => [ resource_path('views/vendor/mail'), ], ], I have created a new template in…
Adam Lambert
  • 1,311
  • 3
  • 24
  • 45
1
2
3
9 10