PHP code example of laravel-notification-channels / 46elks

1. Go to this page and download the library: Download laravel-notification-channels/46elks 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/ */

    

laravel-notification-channels / 46elks example snippets

 php
	'46elks' => [
		'username' => env('FORTY_SIX_ELKS_USERNAME'),
		'password' => env('FORTY_SIX_ELKS_PASSWORD'),
	],
 php
use NotificationChannels\FortySixElks\FortySixElksChannel;
use NotificationChannels\FortySixElks\FortySixElksSMS;

public function via($notifiable)
{
    return [FortySixElksChannel::class];
}


public function to46Elks($notifiable)
{
    return (new FortySixElksSMS())
        ->line('Testsms')
        ->line('Olle')
        ->to('+46701234567')
        ->from('Emil')
        // ->flash() - Optional
        // ->whenDelivered(URL) - Optional
        // ->dontLog() - Optional
        // ->dry() - Optional
}
 php
Event::listen(NotificationFailed::class, function($event){
    info('Error while sending sms');
});