Download the PHP package blackpig-creatif/epitre without Composer

On this page you can find all versions of the php package blackpig-creatif/epitre. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package epitre

Epitre

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

An editable email copy layer for Laravel Mailables, managed through a Filament v5 panel.

Epitre sits between your Mailable classes and their output. Each template has a Blade view as its default. Editors can override the subject and body per locale through the Filament panel without touching code. If no DB record exists, the Blade view is used as-is.

Requirements


Installation

Run the migration:

Register the plugin in your PanelProvider:

Epitre will register SpatieTranslatablePlugin automatically if it is not already present. It reads your locale list from config('app.locales') if that key exists (expected format: ['en' => 'English', 'fr' => 'Francais']), falling back to app()->getLocale().


Quick Start

1. Generate a template class

This creates:

2. Define tokens and resolution logic

Open the generated class and fill in the tokens your template uses:

3. Register the template in your service provider

4. Wire up your Mailable

Add the HasEpitreTemplate trait and implement the two required members:

The trait provides envelope() and content(). Do not implement those methods yourself.


Converting an Existing Mailable

If you have a Mailable already in production, the migration is straightforward.

Before:

Steps:

1. Generate the template class, pointing at your existing Blade view:

Open the generated class and set $view to your existing view, define any tokens, and implement resolve():

2. Register the template in your service provider:

3. Update the Mailable. Remove envelope() and content(), add the trait and the two required members:

Your existing Blade view continues to work unchanged since no DB record exists yet. Editors can customise the copy through the panel at any point, and the Blade view remains the fallback if they haven't.


How Resolution Works

When a Mailable using HasEpitreTemplate is sent, Epitre resolves the content in this order:

Subject: If a DB record exists with a subject for the current locale, it is used with tokens replaced. Otherwise, the template $label is used as the subject.

Body: If a DB record exists with a body for the current locale, it is rendered as an HTML string with tokens replaced. If a $layout is set on the template, the resolved HTML is passed to the layout view as $body instead. Otherwise the body is returned as a raw htmlString with no wrapping. If no DB record exists, the Blade view is rendered via Content(view: ...) with epitreData() passed as view data.

This means your Blade view is always the working default. Editors only override when they want to.


Template Classes

All template classes extend EpitreTemplate:

The $tokens array is informational only. It is displayed in the Filament editor sidebar so editors know what substitutions are available. The resolve() method maps token strings to their runtime values given the data array from epitreData().

Layouts

When editors save content through the Filament panel, Epitre renders it as HTML with tokens replaced. Without a layout, this is returned as a raw htmlString — no wrapping, no styling.

If your emails use a mail layout (Laravel's <x-mail::message>, a custom component, or any Blade view), set $layout on the template to a Blade view path. Epitre will render that view with two variables available: $body (the resolved HTML) and everything from epitreData().

Create the layout view:

Epitre renders layout views through Laravel's mail rendering pipeline, which is the only way <x-mail::message> and related components are available. This pipeline also inlines CSS from your mail theme into the output, which is necessary for email client compatibility. Your stored HTML body is output raw via {!! $body !!} — nothing is converted to or processed as Markdown. The pipeline name is a Laravel implementation detail you do not need to think about.

The $layout only applies when a DB record exists. The $view default continues to use its own layout as normal.


Filament Resource

Registering EpitrePlugin adds an Email Templates resource to your panel.

List view shows all registered templates with their current status:

Status Meaning
Using default No DB record exists, Blade view is active
Customised A DB record overrides the subject and/or body

Edit view lets editors set the subject and body per locale. The sidebar shows the available tokens for that template. Saving creates or updates the DB record. Leaving a field empty falls back to the Blade view default.

Reset to default (visible only when a DB record exists) deletes the record and restores the Blade view default. Requires confirmation.


Translation

Subject and body are stored as translatable JSON columns via spatie/laravel-translatable. The Filament editor uses the locale switcher from lara-zeus/spatie-translatable to manage per-locale content.

Configure your available locales in config/app.php:

Epitre reads this at boot time to configure the translatable plugin. If you are already registering SpatieTranslatablePlugin yourself with locales set, Epitre will not overwrite them.


Testing

Changelog

Please see CHANGELOG for recent changes.

Credits

License

MIT. See LICENSE for details.


All versions of epitre with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3|^8.4
filament/filament Version ^5.0
lara-zeus/spatie-translatable Version ^2.0
spatie/laravel-package-tools Version ^1.15.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package blackpig-creatif/epitre contains the following files

Loading the files please wait ...