PHPackages                             skywebdev/laravel-db-mail - 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. skywebdev/laravel-db-mail

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

skywebdev/laravel-db-mail
=========================

Allow users to edit email (blade) templates

v1.0.0(1y ago)10MITPHPPHP ^8.0

Since May 8Pushed 1y ago1 watchersCompare

[ Source](https://github.com/SkyWebDev/DbMail)[ Packagist](https://packagist.org/packages/skywebdev/laravel-db-mail)[ Docs](https://github.com/SkyWebDev/DbMail)[ RSS](/packages/skywebdev-laravel-db-mail/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (3)Used By (0)

DbMail
------

[](#dbmail)

### Overview

[](#overview)

A Laravel package that allow your customers to edit email templates (html and markdown).

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

[](#installation)

### Requirements

[](#requirements)

The package has been developed and tested to work with the following minimum requirements:

- PHP 8.0
- Laravel 8.0

### Install the Package

[](#install-the-package)

You can install the package via Composer:

```
composer require skywebdev/laravel-db-view
```

### Migrate the Database

[](#migrate-the-database)

This package contains migration that add table: `blade_templates`. To run these migration, simply run the following command:

```
php artisan migrate
```

### Import existing blade templates

[](#import-existing-blade-templates)

After migration you should run following seeder that will import email templates to database.

```
php artisan db:seed --class="SkyWebDev\Database\Seeders\AddBladeTemplatesSeeder"
```

You should run this seeder whenever new email template is added.

Using
-----

[](#using)

After installation your Mailable class will read body and subject from table `blade_templates`. You can allow customers to change them on front using rich text and markdown editors.

### Routes

[](#routes)

Package contains CRUD routes for maintaining `blade_templates` tables. Nothing special, I would just emphasize that delete is actually revert to original. Delete will revert content and subject to be same as defined in blade file. Update and delete will clear view cache.

VerbURIActionNameGET/blade-templatesindexblade-templates.indexPOST/blade-templatescreateblade-templates.createGET/blade-templates/{bladeTemplate}showblade-templates.showPUT/blade-templates/{bladeTemplate}updateblade-templates.updateDELETE/blade-templates/{bladeTemplate}destroyblade-templates.destroyExample
-------

[](#example)

Create markdown mail

```
php artisan make:mail TestMail --markdown=test_mail
```

This command will create ` App\Mail\TestMail`

```
