PHP code example of esign / laravel-email-whitelisting

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

    

esign / laravel-email-whitelisting example snippets


return [
    /**
     * This is used to disable or enable the use of this package.
     */
    'enabled' => env('EMAIL_WHITELISTING_ENABLED', false),

    /**
     * This is the driver responsible for providing whitelisted email addresses.
     * It should implement the EmailWhitelistingDriverContract interface.
     */
    'driver' => \Esign\EmailWhitelisting\Drivers\ConfigurationDriver::class,

    /**
     * Enabling this setting will cause all outgoing emails to be sent to the
     * configured email adresses, disregarding if they're present in To, Cc or Bcc.
     * When using the config driver these will be the addresses defined in the 'mail_addresses' config key.
     * When using the database driver these will be the addresses where 'redirect_email' is true.
     */
    'redirecting_enabled' => env('EMAIL_WHITELISTING_REDIRECTING_ENABLED', false),

    /**
     * When using the config driver you can define email addresses in this array.
     */
    'mail_addresses' => [
        // '[email protected]'
    ],
];

use Esign\EmailWhitelisting\Models\WhitelistedEmailAddress;

WhitelistedEmailAddress::create(['email' => '[email protected]']);
bash
php artisan vendor:publish --provider="Esign\EmailWhitelisting\EmailWhitelistingServiceProvider" --tag="config"
bash
php artisan vendor:publish --provider="Esign\EmailWhitelisting\EmailWhitelistingServiceProvider" --tag="migrations"