File: D:/HostingSpaces/SBogers68/otium-gebiedsontwikkeling.nl/app/Posts/Kms/PostSection.php
<?php
namespace App\Posts\Kms;
use App\Components\ComponentTypes;
use Illuminate\Database\Eloquent\Model;
use Komma\KMS\Core\Attributes\ComponentArea;
use Komma\KMS\Core\Attributes\DatePicker;
use Komma\KMS\Core\Attributes\Documents;
use Komma\KMS\Core\Attributes\OnOff;
use Komma\KMS\Core\Attributes\TextArea;
use Komma\KMS\Core\Attributes\TextField;
use Komma\KMS\Core\Sections\Section;
final class PostSection extends Section
{
/**
* Define the attributes and tabs for this section.
*
* @param Model $currentModel
*/
public function defineAttributesAndTabs(Model $currentModel = null): void
{
$this->tabs->makeTab()->addItems([
(new OnOff())
->setReference('active')
->setLabelText(__('KMS::global.active'))
->switchOn(),
(new DatePicker())
->setReference('date')
->setLabelText(__('KMS::global.date'))
->setTimeEnabled(false),
(new Documents())
->setReference('posts')
->setLabelText(__('KMS::global.index_image'))
->onlyAllowImages()
->setSmallDragAndDropArea()
->setMaxDocuments(1)
->setSubFolder('posts'),
]);
$this->tabs->makeLanguageTabTemplate()->addItems([
(new TextField())
->setReference('name')
->setLabelText(__('KMS::global.title')),
(new TextArea())
->setReference('meta_description')
->setLabelText(__('KMS::global.shortDescription')),
(new ComponentArea())
->setReference('post_components')
->setSubFolder('post_component_data')
->setComponentTypes([
ComponentTypes::TEXT,
ComponentTypes::IMAGE,
ComponentTypes::VIDEO,
]),
]);
}
}