How can I send an nexmo SMS using livewire? - laravel

I have my codes working fine but the SMS is not sent to the mobile number. I am using livewire components and everywhere I'm searching about Nexmo sms notification, it about using controllers. How can I use livewire to send the sms

I've not actually played around with Livewire that much, but the reason that the examples in the PHP library you're using have controllers as sample code is because the controllers are where the logic is used to send a payload of data (in this case, the SMS data) to the Vonage servers.
Livewire is the frontend of your app, where you can define behaviour that replaces the traditional features of Javascript. What it sounds like you need to do is send a value back from the livewire templates to your Laravel controllers. Have a look at the Livewire docs here:
https://laravel-livewire.com/docs/2.x/actions
To see how to do actions.

Related

Send message and files to whatsapp using laravel

How can I send WhatsApp message using laravel?
Please help me to find out with the environment setup.
wp::send('work.data', ['user' => $seleteced_pic], function ($m)
Should it be this way?
In Laravel there are no build in ability to send messages via WhatsApp.
You will need to integrate with WhatsApp API or use third party serves.
The first google search give me this result. https://www.twilio.com/blog/create-laravel-php-notification-channel-whatsapp-twilio
One of the third party serves that simplify iteration with messaging serves.
But you could integrate with WhatsApp directly.
https://www.whatsapp.com/business/api

Sending web push notifications from Laravel

I have a website running Laravel in the back-end, where users can create reports for other users.
When the report is created I would like to send a push notification to recipient user's desktop.
Do I need to use services like Pusher, OneSignal?
Any useful site with examples would be appreciated.
Your question
You could use Pusher, Redis/Socket.io, Pubnub, etc. Which one to use? well, this is more an opinion-based question.
These services broadcast events, then in your client apps (like your web front-end) you configure the client-side libraries of the service you choose to subscribe (to channels) and listen to those events. The documentation explains it better.
Examples/tutorials
Pusher
This is a tutorial published by the Pusher team.
Redis/Socket.io
This one
is a Laracasts series about this.
Just google.
Update
There is a Laravel-specific alternative, a package created exclusively for Laravel:
Laravel WebSockets
This is the post talking about the package and its inner working.
This is the repo.
Here you have the documentation.
If you like to show Native Desktop notification then i would suggest Web Push notification. In this way once user subscribed to push notification ,they will get real time notification and does not need to be on your website.
https://github.com/laravel-notification-channels/webpush

Consuming Laravel Passport API with javascript (React + Axios) from another application

I have managed to make run Laravel 5.4 and implemented the API Authentication (Passport).
What I would try to achieve is to make this as my API server and build React applications that would interact on this API.
Does this mean I have to make routes on routes\api.php?
Let's say I have a React app name requestform on development and running on http://127.0.0.1:8080. How will I consume an api route with axios or jquery?
I can't seem to make the correct keyword to search on google and all the samples I can get are the ones that the API and the javascript application is on the same domain.
This post may have been answered by now. But if not then...
I think you are in the right track..
Does this mean I have to make routes on routes\api.php?
Yes. Your API routes will depend on this file.
Let's say I have a React app name requestform on development and running on http://127.0.0.1:8080. How will I consume an api route with axios or jquery?
Make sure your API Server is running, say it's on http://server.dev, you can consume the API in another app by http://server.dev/api/[your-routes].
I can't seem to make the correct keyword to search on google and all the samples I can get are the ones that the API and the javascript application is on the same domain.
This is a matter of what front-end programming you know. You can use any javascript knowledge to consume your own API with the same domain. There is already a Vue integration packaged in Laravel 5.4+ or just plain vanilla javascript or jQuery.

Chat laravel 5 and notificaciones whit Whatsapp

I'm doing a system with laravel 5 and want have a method of notification alerts to phone mobile. I have read that I can do it with whatsapi but not as useful or good that is.
Any advice or recommendation?
You could do through push notifications, I would recommend you use this library https://packagist.org/packages/davibennun/laravel-push-notification to integrate to Laravel. You can send with push notification a payload with data for your app use it.

Getting view as string in asp.net mvc for email sending

I want to use Mailgun (or maybe Sendgrid) to send emails from my app.
This is pretty straightforward cause I can use RestSharp to interact with their api.
The problem lies in the fact that generating an HTML email is a PITA if I cant use razor.
I know there are two nuget packages (Postal, MvcMailer) that handle this problem quite nicely but they force me to use a SMTP server and I dont want or need that at all.
I just want to keep using the Mailgun API to send emails but I want to have a way to generate the markup for those emails using Razor.
How can I do this?
Please Help.
If you have a partial you can render it to a string, as in the following SO question: link

Resources