PHP code example of norbis / laravel-log-notification-channel

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

    

norbis / laravel-log-notification-channel example snippets


// config/app.php
'providers' => [
    ...
    NotificationChannels\LogChannel\LogChannelServiceProvider::class,
],

// config/services.php
...
/* Настройки */
'logchannel' => [
    /* Канал лога уведомлений по-умолчанию */
    'channel' => 'daily',
],
...

use Illuminate\Notifications\Notification;
use NotificationChannels\LogChannel\LogMessage;

class AccountApproved extends Notification
{
    public function via($notifiable)
    {
        return ['log'];
    }

    public function toLog($notifiable)
    {
        return LogMessage::create("Task #{$notifiable->id} is complete!");
    }
}

public function routeNotificationForLog()
{
    return $this->phone;
}