PHP code example of utcl / utelsms

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

    

utcl / utelsms example snippets


'utelsms' => [
    'baseDomain'      => env('UTCL_BASE_DOMAIN'),
    'token'           => env('UTCL_KEY'),
    'from'          => env('UTCL_FROM'),
]



namespace App;

use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;

class User extends Authenticatable
{
    use Notifiable;

    /**
     * Route notifications for the channel.
     *
     * @param  \Illuminate\Notifications\Notification  $notification
     * @return string
     */
    public function routeNotificationForUTelSms($notification)
    {
        return $this->phone_number;
    }
}



use NotificationChannels\UTelSms\UTelSmsChannel;
use NotificationChannels\UTelSms\UTelSmsMessage;

class NewsWasPublished extends Notification
{

    /**
     * Get the notification's delivery channels.
     *
     * @param  mixed  $notifiable
     * @return array
     */
    public function via($notifiable)
    {
        return [UTelSmsChannel::class];
    }

    public function toUTelSms($notifiable)
    {
		return (new UTelSmsMessage())
                    ->content('Your SMS message content');

    }
}
 php
        return (new UTelSmsMessage())
                    ->content("Your SMS message content")
                    ->to("put the recipient phone number here"); //eg ->to(716094525)
 php
        return (new UTelSmsMessage())
                    ->content("Your SMS message content")
                    ->to("put the recipient phone number here"); //eg ->to(716094525)