D
D
Dmitry2017-01-24 10:13:04
Laravel
Dmitry, 2017-01-24 10:13:04

How to properly set up notifications in Laravel 5.3?

Hello everyone;)
I needed to fasten the sending of SMS to users. Historically, I use smsc.ru, so I decided to continue doing it. I came across laravel-notification-channels/smsc-ru . Like what you need. It seems that I did everything according to the instructions (before that, I did not work with notifications in the lara). And so I already tried, and that - does not want to send SMS and that's it. And the worst thing is that he is silent like a partisan. I would be grateful if someone helps me raise this matter, at least where to dig.
UPD #1: In particular, the questions are:
1) What field is this notification interested in in the database? How does he know where the phone number is? How to ask him to use some other field in the database for this model?
(Indirectly, I understand how to do this, route for notification in the model itself like $this->owner->phone, but does not work)
2) How to send a notification from the controller?
(I tried both Notification::send(User:all(), new ActivateUser) and \Auth::user->notify() in all sorts of variations, deafly)
ATP.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry, 2017-01-24
@totalcount

So, here is the solution, suddenly someone will need it:
Correct like this:

public function routeNotificationForSmscRu()
{
return $this->phone;
}

'smscru' => [
'login' => 'login',
'secret' => 'password',
'sender' => ''
],

Александр Аксентьев, 2017-01-24
@Sanasol Куратор тега Laravel

routeNotificationForSmscru
laravel-notification-channels.com/gcm
https://laravel.com/docs/5.3/notifications#sending...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question