PHPackages                             hxm/laravel-database-email-template - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Templating &amp; Views](/categories/templating)
4. /
5. hxm/laravel-database-email-template

ActiveLibrary[Templating &amp; Views](/categories/templating)

hxm/laravel-database-email-template
===================================

Flexible customization of email template content, with blade file format. content will be stored in database.

0.1.1(1y ago)48MITPHPPHP ^7.0|^8.0

Since Sep 13Pushed 1y ago3 watchersCompare

[ Source](https://github.com/hoanxuanmai/laravel-database-email-template)[ Packagist](https://packagist.org/packages/hxm/laravel-database-email-template)[ RSS](/packages/hxm-laravel-database-email-template/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (1)Versions (3)Used By (0)

Laravel Database Email Template
===============================

[](#laravel-database-email-template)

Flexible customization of email template content, with blade file format. content will be stored in database.

Able to store:

- Template type: markdown, view
- Subject: only text
- Body

Installation
------------

[](#installation)

```
composer require hxm/laravel-database-email-template
```

- Run migrations to create database table:

```
php artisan migrate
```

- Publishing the config file

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

- Create new mailable with instance of DatabaseEmailTempplateIntercafe via command:

```
php artisan database-email-template:create DemoMailable --markdown=mail.demo_mailable

# this command will create new Class \App\Mail\DemoMailable
# new template file will be add on folder resources/mail
# markdown is option
```

- After that, you need to add this class `\App\Mail\DemoMailable` into config file. This is the default content of the config file:

```
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'
    ]
];
```

- You can also add your mailable via the boot function in your ServiceProvider:

```
use HXM\LaravelDatabaseEmailTemplate\Facades\DatabaseEmailTemplate;

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

This package will automatically register the event listeners and data will be inserted into database.

Using
=====

[](#using)

- Access Admin route index via browser by your config route prefix, by default `https://{yourhost}/database-email-templates`

[![image](https://github.com/hoanxuanmai/laravel-database-email-template/raw/main/images/index.png?raw=true)](https://github.com/hoanxuanmai/laravel-database-email-template/blob/main/images/index.png?raw=true)

- Create new

[![image](https://github.com/hoanxuanmai/laravel-database-email-template/raw/main/images/create.png?raw=true)](https://github.com/hoanxuanmai/laravel-database-email-template/blob/main/images/create.png?raw=true)

- To save the content in the database, you must use the preview function, to make sure there are no errors, then the save button appears.

[![image](https://github.com/hoanxuanmai/laravel-database-email-template/raw/main/images/preview.png?raw=true)](https://github.com/hoanxuanmai/laravel-database-email-template/blob/main/images/preview.png?raw=true)

Please let me know if there is any problem or need any help. Your contribution is valuable to make the package better.
----------------------------------------------------------------------------------------------------------------------

[](#please-let-me-know-if-there-is-any-problem-or-need-any-help-your-contribution-is-valuable-to-make-the-package-better)

Please note currently for Laravel 7+ until tested and verified in lower versions.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance36

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity35

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~17 days

Total

2

Last Release

589d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/253837bebf61531c6bb369dad0dd5e54136bd557b6583f058301ad837d5fa8dc?d=identicon)[hoanxuanmai](/maintainers/hoanxuanmai)

---

Top Contributors

[![hoanxuanmai](https://avatars.githubusercontent.com/u/47692574?v=4)](https://github.com/hoanxuanmai "hoanxuanmai (4 commits)")

---

Tags

laravelemail-templatehxmcustomer-email-templatedatabase-emailemdatabase-email-template

### Embed Badge

![Health badge](/badges/hxm-laravel-database-email-template/health.svg)

```
[![Health](https://phpackages.com/badges/hxm-laravel-database-email-template/health.svg)](https://phpackages.com/packages/hxm-laravel-database-email-template)
```

###  Alternatives

[cagilo/cagilo

A set of open-source Blade components for the Laravel Framework

172996.5k](/packages/cagilo-cagilo)[itstructure/laravel-grid-view

Grid view for laravel framework

2546.6k2](/packages/itstructure-laravel-grid-view)[ycs77/inertia-laravel-ssr-head

Simple SSR Head for Inertia Laravel

3211.5k](/packages/ycs77-inertia-laravel-ssr-head)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
