1. Go to this page and download the library: Download ishaarat/lara-ishaarat library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
# On the top of the file.
use Ishaarat\LaraIshaarat\Facades\WA;
////
# In your Controller.
WA::send("this message", function($waMsg) {
$waMsg->to(['Number 1', 'Number 2']); # The numbers to send to.
});
# OR...
WA::send("this message")->to(['Number 1', 'Number 2'])->dispatch();
ishaaratWA()->send("this message", function($waMsg) {
$waMsg->to(['Number 1', 'Number 2']); # The numbers to send to.
});
ishaaratWA()->send("this message")->to(['Number 1', 'Number 2'])->dispatch();
namespace App\Notifications;
use Ishaarat\LaraIshaarat\Builder;
use Illuminate\Bus\Queueable;
use Ishaarat\LaraIshaarat\Channels\WAChannel;
use Illuminate\Notifications\Notification;
use Illuminate\Contracts\Queue\ShouldQueue;
class InvoicePaid extends Notification
{
use Queueable;
/**
* Get the notification channels.
*
* @param mixed $notifiable
* @return array|string
*/
public function via($notifiable)
{
return [WAChannel::class];
}
/**
* Get the repicients and body of the notification.
*
* @param mixed $notifiable
* @return Builder
*/
public function toWhatsapp($notifiable)
{
return (new Builder)
->send('this message')
->to('some number');
}
}
$builder = (new Builder)
->send('this message')
->to('some number');
WA::send($builder);