File: D:/HostingSpaces/SBogers10/momsecurity.komma.nl/app/Components/Types/FullImage.php
<?php
namespace App\Components\Types;
use App\Components\ComponentTypes;
use Komma\KMS\Components\ComponentType\Types\AbstractComponentType;
use Komma\KMS\Core\Attributes\Documents;
use Komma\KMS\Core\Attributes\Models\ImageProperty;
class FullImage extends AbstractComponentType
{
protected int $id = ComponentTypes::FULL_IMAGE;
protected string $name = 'full-image';
public function defineAttributesAndTabs()
{
$this->addItems([
(new Documents())
->setReference('image')
->setLabelText(__('KMS::attributes/components.image'))
->onlyAllowImages()
->setSmallDragAndDropArea()
->setSubFolder('component_uploads')
->setMaxDocuments(1)
->setImageProperties([
(new ImageProperty())->setName('large')->setCropMethod(ImageProperty::Resize)->setWidth(1800),
(new ImageProperty())->setName('medium')->setCropMethod(ImageProperty::Resize)->setWidth(1000),
(new ImageProperty())->setName('small')->setCropMethod(ImageProperty::Resize)->setWidth(600),
]),
]);
}
}