major
parent
a604770a74
commit
cba577cb2b
|
|
@ -8,7 +8,6 @@ use League\Fractal\TransformerAbstract;
|
||||||
|
|
||||||
class FieldsGroupTransformer extends TransformerAbstract {
|
class FieldsGroupTransformer extends TransformerAbstract {
|
||||||
protected array $defaultIncludes = [
|
protected array $defaultIncludes = [
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
||||||
protected array $availableIncludes = [
|
protected array $availableIncludes = [
|
||||||
|
|
|
||||||
|
|
@ -16,14 +16,14 @@ use League\Fractal\TransformerAbstract;
|
||||||
|
|
||||||
class PublicationTransformer extends TransformerAbstract {
|
class PublicationTransformer extends TransformerAbstract {
|
||||||
protected array $defaultIncludes = [
|
protected array $defaultIncludes = [
|
||||||
|
'poster'
|
||||||
];
|
];
|
||||||
|
|
||||||
protected array $availableIncludes = [
|
protected array $availableIncludes = [
|
||||||
'page', 'poster', 'author', 'sections', 'sidebars', 'permissions'
|
'page', 'poster', 'author', 'sections', 'sidebars', 'permissions'
|
||||||
];
|
];
|
||||||
|
|
||||||
public function transform(Page $model): array {
|
public function transform(Publication $model): array {
|
||||||
return [
|
return [
|
||||||
'id' => $model->uuid,
|
'id' => $model->uuid,
|
||||||
'slug' => $model->slug,
|
'slug' => $model->slug,
|
||||||
|
|
@ -42,7 +42,7 @@ class PublicationTransformer extends TransformerAbstract {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function includePoster(Publication $model): ?Item {
|
public function includePoster(Publication $model): ?Item {
|
||||||
return $model->poster ? $this->item($model->poster, new AssetTransformer()) : null;
|
return $model->poster ? $this->item($model->poster, new AssetTransformer()) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function includeAuthor(Publication $model): ?Item {
|
public function includeAuthor(Publication $model): ?Item {
|
||||||
|
|
|
||||||
|
|
@ -32,16 +32,6 @@ class FieldsTableSeeder extends Seeder {
|
||||||
'required' => true
|
'required' => true
|
||||||
],
|
],
|
||||||
|
|
||||||
'text' => [
|
|
||||||
'title' => 'Содержимое текстового блока',
|
|
||||||
'type' => FieldType::TEXT
|
|
||||||
],
|
|
||||||
'text-required' => [
|
|
||||||
'title' => 'Содержимое текстового блока',
|
|
||||||
'type' => FieldType::TEXT,
|
|
||||||
'required' => true
|
|
||||||
],
|
|
||||||
|
|
||||||
'html' => [
|
'html' => [
|
||||||
'title' => 'Содержимое текстового блока',
|
'title' => 'Содержимое текстового блока',
|
||||||
'type' => FieldType::HTML
|
'type' => FieldType::HTML
|
||||||
|
|
@ -52,21 +42,21 @@ class FieldsTableSeeder extends Seeder {
|
||||||
'required' => true
|
'required' => true
|
||||||
],
|
],
|
||||||
|
|
||||||
'list-type' => [
|
// 'list-type' => [
|
||||||
'title' => 'Вид списка',
|
// 'title' => 'Вид списка',
|
||||||
'type' => FieldType::RELATION,
|
// 'type' => FieldType::RELATION,
|
||||||
'required' => true,
|
// 'required' => true,
|
||||||
'params' => [
|
// 'params' => [
|
||||||
'related' => DictionaryItem::class, 'transformer' => DictionaryItemTransformer::class,
|
// 'related' => DictionaryItem::class, 'transformer' => DictionaryItemTransformer::class,
|
||||||
'options' => ['show' => true, 'whereHas' => ['dictionary' => ['name' => 'list-types']]]
|
// 'options' => ['show' => true, 'whereHas' => ['dictionary' => ['name' => 'list-types']]]
|
||||||
]
|
// ]
|
||||||
],
|
// ],
|
||||||
'list-items' => [
|
// 'list-items' => [
|
||||||
'title' => 'Элементы списка',
|
// 'title' => 'Элементы списка',
|
||||||
'type' => FieldType::TEXT,
|
// 'type' => FieldType::TEXT,
|
||||||
'multiple' => true,
|
// 'multiple' => true,
|
||||||
'required' => true
|
// 'required' => true
|
||||||
],
|
// ],
|
||||||
|
|
||||||
'images' => [
|
'images' => [
|
||||||
'title' => 'Изображения',
|
'title' => 'Изображения',
|
||||||
|
|
|
||||||
|
|
@ -20,21 +20,16 @@ class ObjectTypeFieldsTableSeeder extends Seeder {
|
||||||
'fields' => ['header-required']
|
'fields' => ['header-required']
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
'page-section-text' => [
|
|
||||||
'common' => [
|
|
||||||
'fields' => ['text-required']
|
|
||||||
]
|
|
||||||
],
|
|
||||||
'page-section-html' => [
|
'page-section-html' => [
|
||||||
'common' => [
|
'common' => [
|
||||||
'fields' => ['html-required']
|
'fields' => ['html-required']
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
'page-section-list' => [
|
// 'page-section-list' => [
|
||||||
'common' => [
|
// 'common' => [
|
||||||
'fields' => ['list-type', 'list-items']
|
// 'fields' => ['list-type', 'list-items']
|
||||||
]
|
// ]
|
||||||
],
|
// ],
|
||||||
'page-section-images' => [
|
'page-section-images' => [
|
||||||
'common' => [
|
'common' => [
|
||||||
'fields' => ['images-required']
|
'fields' => ['images-required']
|
||||||
|
|
|
||||||
|
|
@ -16,15 +16,12 @@ class ObjectTypesTableSeeder extends Seeder {
|
||||||
'page-section-header' => [
|
'page-section-header' => [
|
||||||
'title' => 'Заголовок'
|
'title' => 'Заголовок'
|
||||||
],
|
],
|
||||||
'page-section-text' => [
|
'page-section-html' => [
|
||||||
'title' => 'Текстовый блок'
|
'title' => 'Текстовый блок'
|
||||||
],
|
],
|
||||||
'page-section-html' => [
|
// 'page-section-list' => [
|
||||||
'title' => 'Текстовый блок с разметкой'
|
// 'title' => 'Список'
|
||||||
],
|
// ],
|
||||||
'page-section-list' => [
|
|
||||||
'title' => 'Список'
|
|
||||||
],
|
|
||||||
'page-section-images' => [
|
'page-section-images' => [
|
||||||
'title' => 'Изображения'
|
'title' => 'Изображения'
|
||||||
],
|
],
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue