PHP code example of tompec / laravel-email-log

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

    

tompec / laravel-email-log example snippets


return [
    /*
     * This is the name of the table that will be created by the migration.
     */
    'table_name' => 'email_log',

    /*
     * The model that will be attached to the email logs.
     */
    'recipient_model' => \App\User::class,

    /*
     * This is the name of the column that the `recipient_model` uses to store the email address.
     */
    'recipient_email_column' => 'email',

    /*
     * Whether or not you want to log emails that don't belong to any model
     */
    'log_unknown_recipients' => true,
];

public function email_logs()
{
    return $this->morphMany(\Tompec\EmailLog\EmailLog::class, 'recipient');
}
 php
'providers' => [
    Tompec\EmailLog\EmailLogServiceProvider::class,
],
bash
php artisan migrate
bash
php artisan vendor:publish --provider="Tompec\EmailLog\EmailLogServiceProvider"
 bash
php artisan nova:resource EmailLog