Skip to content

Commit

Permalink
Merge pull request #13 from murdercode/12-always-show-on-detail-page
Browse files Browse the repository at this point in the history
Add Expandable
  • Loading branch information
murdercode authored Jun 16, 2023
2 parents c09fe05 + c433237 commit f881198
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/TinymceEditor.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@

namespace Murdercode\TinymceEditor;

use Laravel\Nova\Fields\Expandable;
use Laravel\Nova\Fields\Field;
use Laravel\Nova\Fields\SupportsDependentFields;

class TinymceEditor extends Field
{
use SupportsDependentFields;
use Expandable;

/**
* The field's component.
Expand Down Expand Up @@ -41,4 +43,14 @@ public function options($options)
'options' => array_merge($inlineOptions, $options),
]);
}

/**
* Prepare the element for JSON serialization.
*/
public function jsonSerialize(): array
{
return array_merge(parent::jsonSerialize(), [
'shouldShow' => $this->shouldBeExpanded(),
]);
}
}

0 comments on commit f881198

Please sign in to comment.