Skip to content
Advertisement

How to send message to selected user with their name laravel

I’m trying to send a message to selected users with their names. So let’s say I have two users Ethan and Calvin then the message should start like User1:(Hi, Ethan), User2:(Hi, Calvin). So far the message is like (Hi, Ethan,Calvin) for every user. How can I fix this?

Blade

JavaScript

Controller

JavaScript

Advertisement

Answer

It looks like it’s a problem with names and phones you also, sending message to $phone_number which looks like this 965XXXX,965XXXX,..., try this

JavaScript

the full code will be

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement