PHP code example of pasya / onesender-laravel

1. Go to this page and download the library: Download pasya/onesender-laravel 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/ */

    

pasya / onesender-laravel example snippets



return [
	'phone_column' 	=> 'phone',
	'base_api_url' 	=> 'http://onesender.my.id',
	'api_key' 		=> 'YOUR_API_KEY',
];

php artisan make:notification PesanWhatsApp



namespace App\Notifications;

use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Notification;

class PesanWhatsApp extends Notification
{
    use Queueable;

    public $content;
   
    public function __construct(array $payload)
    {
        $this->content = $payload['content'];
    }

    public function via($notifiable)
    {
        return ['onesender'];
    }
}