PHPackages                             idf/nova-unlayer-field - 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. idf/nova-unlayer-field

Abandoned → [interaction-design-foundation/nova-unlayer-field](/?search=interaction-design-foundation%2Fnova-unlayer-field)Library

idf/nova-unlayer-field
======================

A Laravel Nova field for Unlayer to compose emails and landing pages.

2.2.0(1y ago)3535.9k—0%9[2 issues](https://github.com/InteractionDesignFoundation/nova-unlayer-field/issues)MITVuePHP ^8.1CI failing

Since Nov 26Pushed 2mo ago10 watchersCompare

[ Source](https://github.com/InteractionDesignFoundation/nova-unlayer-field)[ Packagist](https://packagist.org/packages/idf/nova-unlayer-field)[ RSS](/packages/idf-nova-unlayer-field/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (5)Versions (30)Used By (0)

Nova Unlayer Field
==================

[](#nova-unlayer-field)

[![image](https://user-images.githubusercontent.com/5278175/144930172-1bf257ee-54a6-4c88-a3a8-772a1d687677.png)](https://user-images.githubusercontent.com/5278175/144930172-1bf257ee-54a6-4c88-a3a8-772a1d687677.png)

[![Latest Stable Version](https://camo.githubusercontent.com/81d6729627e1dec98fbb098105120313adcbbd30d46645570346ff240f3c689c/68747470733a2f2f706f7365722e707567782e6f72672f696e746572616374696f6e2d64657369676e2d666f756e646174696f6e2f6e6f76612d756e6c617965722d6669656c642f76)](https://packagist.org/packages/interaction-design-foundation/nova-unlayer-field)[![Total Downloads](https://camo.githubusercontent.com/fc915bc6be665ca29d38fc81b7c74710946a732d54b8210c3eeaa4eb03a7e98a/68747470733a2f2f706f7365722e707567782e6f72672f696e746572616374696f6e2d64657369676e2d666f756e646174696f6e2f6e6f76612d756e6c617965722d6669656c642f646f776e6c6f616473)](https://packagist.org/packages/interaction-design-foundation/nova-unlayer-field)[![License](https://camo.githubusercontent.com/2166734cfe694db0c6c53a0fb2a091d22a02474fb0c503c8a7de5cede04d0508/68747470733a2f2f706f7365722e707567782e6f72672f696e746572616374696f6e2d64657369676e2d666f756e646174696f6e2f6e6f76612d756e6c617965722d6669656c642f6c6963656e7365)](https://packagist.org/packages/interaction-design-foundation/nova-unlayer-field)

Adds a Laravel Nova field for Unlayer to compose emails and landing pages.

[![image](https://github.com/InteractionDesignFoundation/nova-unlayer-field/raw/main/resources/img/demo-800x592@8.gif)](https://github.com/InteractionDesignFoundation/nova-unlayer-field/blob/main/resources/img/demo-800x592@8.gif)

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

[](#installation)

You can install the package in to a Laravel app that uses [Nova](https://nova.laravel.com) via composer:

```
composer require interaction-design-foundation/nova-unlayer-field
```

⚠️ For PHP 7.1 - PHP 7.4 please use [version 0.2.2](https://github.com/InteractionDesignFoundation/nova-unlayer-field/tree/0.2.2) (it uses another namespace).

### Optional: publish the configuration

[](#optional-publish-the-configuration)

Run this on the command line from the root of your project:

```
php artisan vendor:publish --provider="InteractionDesignFoundation\NovaUnlayerField\ServiceProvider" --tag=config
```

Usage
-----

[](#usage)

This package assumes that your Model has an attribute to store Unlayer design config JSON string (it’s better to use `json` or `jsonb` or `longtext` SQL type to store it).

On submit, the package automatically stores Unlayer design config only (JSON string). Most likely, you also want to do something with the output HTML code, generated by Unlayer. To access it, please use `savingCallback()` method (see an extended example below).

Basic field config:

```
use InteractionDesignFoundation\NovaUnlayerField\Unlayer;

public function fields()
{
    return [
        Unlayer::make('Content', 'design')->config([
            'projectId' => config('unlayer.project_id'),

            // optional
            'templateId' => config('unlayer.default_template_id'), // Used only if bound attribute ('design' in this case) is empty.
            'displayMode' => 'web', // "email" or "web". Default value: "email"
            'locale' => 'es', // Locale for Unlayer UI. Default value: application’s locale.
        ]),
     ];
}
```

### Options

[](#options)

- `->config(array|callable $config)`: Specify [Unlayer config](https://docs.unlayer.com/docs/getting-started#section-configuration-options).
- `->height(string $height)`: Set height of the editor (with units). E.g. '1000px' (800px by default).
- `->savingCallback(?callable $callback)`: Specify a callback to call on before Model saving. Useful to store generated HTML code (to a Model or as a file).

Example of using `savingCallback`:

```
Unlayer::make('Design')->config([
        'projectId' => config('unlayer.project_id'),
    ])
    ->savingCallback(function (NovaRequest $request, $attribute, Newsletter $newsletterModel, $outputHtmlFieldName) {
        // set output HTML to your model (Newsletter in this case)
        // No need to call $model->save() — Nova will do it down the road.
        $newsletterModel->html = $request->input($outputHtmlFieldName);
    }),
```

### Changelog

[](#changelog)

Please see [Releases](https://github.com/InteractionDesignFoundation/nova-unlayer-field/releases) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

###  Health Score

53

—

FairBetter than 97% of packages

Maintenance64

Regular maintenance activity

Popularity37

Limited adoption so far

Community21

Small or concentrated contributor base

Maturity77

Established project with proven stability

 Bus Factor1

Top contributor holds 82.2% 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 ~80 days

Recently: every ~191 days

Total

24

Last Release

520d ago

Major Versions

0.2.2 → 1.0.0-beta.12021-07-08

1.0.6 → 2.0.02022-05-03

PHP version history (5 changes)0.0.1PHP &gt;=7.1.0

1.0.0-beta.1PHP ^8.0

1.0.2PHP &gt;=8.0

2.1.1PHP &gt;=8.1

2.1.2PHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/c9acedf8ce33bd0f1b27bc0de9ea640544c778c1752263254e9591b2f2661dec?d=identicon)[alies-dev](/maintainers/alies-dev)

![](https://www.gravatar.com/avatar/da9774cd2a66143b781db8aa0674523bdc7abcd220e5a1a6c54858d3c2665c27?d=identicon)[IxDF](/maintainers/IxDF)

---

Top Contributors

[![alies-dev](https://avatars.githubusercontent.com/u/5278175?v=4)](https://github.com/alies-dev "alies-dev (129 commits)")[![renovate[bot]](https://avatars.githubusercontent.com/in/2740?v=4)](https://github.com/renovate[bot] "renovate[bot] (13 commits)")[![lptn](https://avatars.githubusercontent.com/u/150333538?v=4)](https://github.com/lptn "lptn (8 commits)")[![hasan-wajahat](https://avatars.githubusercontent.com/u/10537472?v=4)](https://github.com/hasan-wajahat "hasan-wajahat (4 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (2 commits)")[![ixdf-bot](https://avatars.githubusercontent.com/u/35728129?v=4)](https://github.com/ixdf-bot "ixdf-bot (1 commits)")

---

Tags

hacktoberfestlaravellaravel-novalaravel-nova-fieldnovaunlayerlaravelhtmlnovalaravel-nova-field

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/idf-nova-unlayer-field/health.svg)

```
[![Health](https://phpackages.com/badges/idf-nova-unlayer-field/health.svg)](https://phpackages.com/packages/idf-nova-unlayer-field)
```

###  Alternatives

[outl1ne/nova-sortable

This Laravel Nova package allows you to reorder models in a Nova resource's index view using drag &amp; drop.

2861.8M9](/packages/outl1ne-nova-sortable)[interaction-design-foundation/nova-unlayer-field

A Laravel Nova field for Unlayer to compose emails and landing pages.

35256.8k](/packages/interaction-design-foundation-nova-unlayer-field)[interaction-design-foundation/nova-html-card

A Laravel Nova card to display arbitrary HTML content

67731.2k3](/packages/interaction-design-foundation-nova-html-card)[interaction-design-foundation/nova-html-code-field

A Laravel Nova field to write raw HTML and preview.

11157.5k](/packages/interaction-design-foundation-nova-html-code-field)[stepanenko3/nova-command-runner

Laravel Nova tool for running Artisan and bash(shell) commands.

36983.0k](/packages/stepanenko3-nova-command-runner)[sbine/route-viewer

A Laravel Nova tool to view your registered routes.

57215.9k](/packages/sbine-route-viewer)

PHPackages © 2026

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