PHP code example of hxm / laravel-database-email-template

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

    

hxm / laravel-database-email-template example snippets



use HXM\LaravelDatabaseEmailTemplate\Mail\DemoDatabaseEmailTemplate;

return [
    /**
     * add Maiables list 
     */
    'mailables' => [
        \App\Mail\DemoMailable::class, //add new
        // DemoDatabaseEmailTemplate::class
    ],

    /**
     * Admin route configs
     */
    'route' => [
        'enable' => true,
        'prefix' => 'database-email-templates',
        'as' => 'database-email-templates',
        'middleware' => ['web', 'auth'],
    ],

    /**
     * view configs
     */
    'view' => [
        'namespace' => 'database_email_template'
    ]
];

use HXM\LaravelDatabaseEmailTemplate\Facades\DatabaseEmailTemplate;

class AppServiceProvider extends ServiceProvider
{
    ...
    function boot() {
        //...
        DatabaseEmailTemplate::addMailable(\App\Mail\DemoMailable::class);
    }
}

bash
php artisan migrate
bash
php artisan vendor:publish --provider="HXM\LaravelDatabaseEmailTemplate\LaravelDatabaseEmailTemplateServiceProvider" --tag="database_email_template_config"