PHP code example of dunp / smsend-laravel

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

    

dunp / smsend-laravel example snippets


namespace Dunp\Smsend\Notifications;

use Dunp\Smsend\SmsendMessage;

class LaMiaNotificaPersonalizzata extends SmsendNotification
{
    public function toSms($notifiable): SmsendMessage
    {
        return $this->message
	    ->quality('N')
	    ->content('Questo è il mio messaggio.')
	    ->from('NomeAzienda')
	    ->scheduledAt('20230331121020')
	    ->to($notifiable);
    }
}

namespace Dunp\Smsend\Notifications;

use Dunp\Smsend\SmsendMessage;
use Illuminate\Database\Eloquent\Collection;

class LaMiaNotificaMultipla extends SmsendNotification
{
    protected Collection $collection;

    public function __construct(Collection $collection)
    {
        parent::__construct();
        $this->collection = $collection;
    }

    public function toSms($notifiable): SmsendMessage
    {
        return $this->message
	    ->multiTo($this->collection);
    }
}