File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -19,15 +19,22 @@ composer require idf/nova-unlayer-field
1919
2020## Usage
2121
22+ This package assumes that your Model has an attribute to store design config
23+ (it's better to use ` json ` or ` longtext ` SQL type to store it).
24+
25+ On submit, the package sends two fields:
26+ - design (stringified json object)
27+ - html code. If you want to store HTML to your model, please use ` savingCallback() `
28+
2229``` php
2330public function fields()
2431{
2532 return [
26- Unlayer::make('Payload Content')->config([
33+ Unlayer::make('Content', 'design ')->config([
2734 'projectId' => config('unlayer.project_id'),
28- 'templateId' => config('unlayer.newsletter_template_id'),
29- 'displayMode' => 'email',
30- 'locale' => app()->getLocale(),
35+ 'templateId' => config('unlayer.newsletter_template_id'), // Optional, used only if bound attribute is empty (e.g. $newsletter->design)
36+ 'displayMode' => 'email', // Optional, "email" by default
37+ 'locale' => app()->getLocale(), // Optional
3138 ]),
3239 ];
3340}
You can’t perform that action at this time.
0 commit comments