mirror of
https://github.com/vitodeploy/vito.git
synced 2025-04-21 19:01:37 +00:00
25 lines
483 B
PHP
25 lines
483 B
PHP
<?php
|
|
|
|
namespace App\Web\Fields;
|
|
|
|
use Filament\Forms\Components\Field;
|
|
|
|
class CodeEditorField extends Field
|
|
{
|
|
protected string $view = 'fields.code-editor';
|
|
|
|
public string $lang = '';
|
|
|
|
public bool $readonly = false;
|
|
|
|
public function getOptions(): array
|
|
{
|
|
return [
|
|
'id' => $this->getId(),
|
|
'name' => $this->getName(),
|
|
'lang' => $this->lang,
|
|
'value' => json_encode($this->getState() ?? ''),
|
|
];
|
|
}
|
|
}
|