File: D:/HostingSpaces/SBogers10/otium.komma.nl/app/Components/Types/TextImage.php
<?php
namespace App\Components\Types;
use Komma\KMS\Core\Attributes\Documents;
use Komma\KMS\Core\Attributes\Models\ImageProperty;
use Komma\KMS\Components\ComponentType\Types\TextImage as KMSTextImage;
use Komma\KMS\Core\Attributes\Seperator;
use Komma\KMS\Core\Attributes\TextArea;
use Komma\KMS\Core\Attributes\Title;
class TextImage extends KMSTextImage
{
public function defineAttributesAndTabs()
{
// parent::defineAttributesAndTabs();
$this->addItems([
(new Title())
->setLabelText(__('KMS::attributes/components.image')),
(new Documents())
->setReference('image')
->onlyAllowImages()
->setSubFolder('component_uploads')
->setMaxDocuments(1)
->setImageProperties([
(new ImageProperty())->setName('large')->setCropMethod(ImageProperty::Resize)->setWidth(1440),
(new ImageProperty())->setName('medium')->setCropMethod(ImageProperty::Resize)->setWidth(900),
(new ImageProperty())->setName('small')->setCropMethod(ImageProperty::Resize)->setWidth(440),
])
->setSmallDragAndDropArea(),
(new Seperator()),
(new Title())
->setLabelText(__('KMS::attributes/components.text')),
(new TextArea())
->setReference('text')
->enableTinymceEditor(),
]);
}
}