PHP code example of techinasia / laravel-mandrill-notification-channel

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

    

techinasia / laravel-mandrill-notification-channel example snippets

 php
NotificationChannels\Mandrill\MandrillServiceProvider::class
 php 
'mandrill' => [
    'secret' => env('MANDRILL_SECRET', ''),
],
 php
use NotificationChannels\Mandrill\MandrillChannel;
use NotificationChannels\Mandrill\MandrillMessage;
use Illuminate\Notifications\Notification;

class TestNotification extends Notification
{
    public function via($notifiable)
    {
        return [MandrillChannel::class];
    }

    public function toMandrill($notifiable)
    {
        return (new MandrillMessage())
            ->template('foo-bar', ['foo' => 'bar']);
    }
}
 php
/**
 * Route notifications for the Mandrill channel.
 *
 * @return array
 */
public function routeNotificationForMandrill()
{
    return [
        'email' => $this->email,
        'name' => $this->name
    ];
}
 php
return (new MandrillMessage())
    ->subject('Test Subject')
    ->mergeLanguage('handlebars');