Download the PHP package skywebdev/laravel-db-mail without Composer
On this page you can find all versions of the php package skywebdev/laravel-db-mail. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download skywebdev/laravel-db-mail
More information about skywebdev/laravel-db-mail
Files in skywebdev/laravel-db-mail
Package laravel-db-mail
Short Description Allow users to edit email (blade) templates
License MIT
Homepage https://github.com/SkyWebDev/DbMail
Informations about the package laravel-db-mail
DbMail
Overview
A Laravel package that allow your customers to edit email templates (html and markdown).
Installation
Requirements
The package has been developed and tested to work with the following minimum requirements:
- PHP 8.0
- Laravel 8.0
Install the Package
You can install the package via Composer:
Migrate the Database
This package contains migration that add table: . To run these migration, simply run the following command:
Import existing blade templates
After migration you should run following seeder that will import email templates to database.
You should run this seeder whenever new email template is added.
Using
After installation your Mailable class will read body and subject from table . You can allow customers to change them on front using rich text and markdown editors.
Routes
Package contains CRUD routes for maintaining 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.
Verb | URI | Action | Name |
---|---|---|---|
GET | /blade-templates | index | blade-templates.index |
POST | /blade-templates | create | blade-templates.create |
GET | /blade-templates/{bladeTemplate} | show | blade-templates.show |
PUT | /blade-templates/{bladeTemplate} | update | blade-templates.update |
DELETE | /blade-templates/{bladeTemplate} | destroy | blade-templates.destroy |
Example
Create markdown mail
This command will create
and view file in markdown format
In add route for displaying mail.
Call in browser and you will see something like this
Run seeder for adding blade templates to db
This seeder will add newly added template to table.
Next, edit body column of newly added template in table. For example append DB in button label.
Clear view cache
Refresh in browser and you will see something like this
Template is rendered from db.