https://github.com/solutionforest/filament-unlayer
This is unlayer plugin for Filamentphp. We used for our Filament Newsletter Paid Plugin
https://github.com/solutionforest/filament-unlayer
Last synced: 16 days ago
JSON representation
This is unlayer plugin for Filamentphp. We used for our Filament Newsletter Paid Plugin
- Host: GitHub
- URL: https://github.com/solutionforest/filament-unlayer
- Owner: solutionforest
- License: mit
- Created: 2024-07-05T06:59:46.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-07-14T04:09:45.000Z (7 months ago)
- Last Synced: 2025-10-22T11:43:19.431Z (4 months ago)
- Language: PHP
- Homepage:
- Size: 50.8 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
## About Solution Forest
[Solution Forest](https://solutionforest.com) Web development agency based in Hong Kong. We help customers to solve their problems. We Love Open Soruces.
We have built a collection of best-in-class products:
- [VantagoAds](https://vantagoads.com): A self manage Ads Server, Simplify Your Advertising Strategy.
- [GatherPro.events](https://gatherpro.events): A Event Photos management tools, Streamline Your Event Photos.
- [Website CMS Management](https://filamentphp.com/plugins/solution-forest-cms-website): Website CMS Management - Filament CMS Plugin
- [Filaletter](https://filaletter.solutionforest.net): Filaletter - Filament Newsletter Plugin
# Filament-unlayer
[](https://packagist.org/packages/solution-forest/filament-unlayer)
[](https://packagist.org/packages/solution-forest/filament-unlayer)
This is where your description should go. Limit it to a paragraph or two. Consider adding a small example.
## Installation
You can install the package via composer:
```bash
composer require solution-forest/filament-unlayer
php artisan filament:assets
```
You can publish and run the migrations with:
```bash
php artisan vendor:publish --tag="filament-unlayer-migrations"
php artisan migrate
```
You can publish the config file with:
```bash
php artisan vendor:publish --tag="filament-unlayer-config"
```
Optionally, you can publish the views using
```bash
php artisan vendor:publish --tag="filament-unlayer-views"
```
This is the contents of the published config file:
```php
return [
];
```
## Usage
This field will save both html and design data as json.
```php
\SolutionForest\FilamentUnlayer\FilamentUnlayer::make('content');
```
## Exporting html
Mount the html state by using function mountHtmlStateTo.
```php
\SolutionForest\FilamentUnlayer\FilamentUnlayer::make('json-content')->mountHtmlStateTo('data.content');
Hidden::make('content');
```
Alternatively, get the html from the field data.
```php
class EditRecord
{
protected function mutateFormDataBeforeSave(array $data): array
{
$data['content'] = $data['json-content']['html'];
return $data;
}
```
## Testing
```bash
composer test
```
## Changelog
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.
## Contributing
Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.
## Security Vulnerabilities
Please review [our security policy](../../security/policy) on how to report security vulnerabilities.
## Credits
- [kelseylee](https://github.com/solutionforest)
- [All Contributors](../../contributors)
## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.
