File: D:/HostingSpaces/SBogers10/otium.komma.nl/app/Servicepoints/Kms/ServicepointSection.php
<?php
namespace App\Servicepoints\Kms;
use Illuminate\Database\Eloquent\Model;
use Komma\KMS\Core\Attributes\Documents;
use Komma\KMS\Core\Attributes\Models\ImageProperty;
use Komma\KMS\Core\Attributes\TextField;
use Komma\KMS\Core\Sections\Section;
final class ServicepointSection extends Section
{
public function defineAttributesAndTabs(Model $currentModel = null): void
{
$this->tabs->makeTab()->addItems([
(new TextField())
->setReference('name')
->setLabelText(__('KMS::global.name')),
(new Documents())
->setReference('servicepoints')
->setLabelText(__('KMS::global.images'))
->onlyAllowImages()
->setSmallDragAndDropArea()
->setMaxDocuments(1)
->setSubFolder('servicepoints')
->setImageProperties([
(new ImageProperty())->setName('small')->setCropMethod(ImageProperty::Fit)->setWidth(176),
]),
]);
$this->tabs->makeLanguageTabTemplate()->addItems([
(new TextField())
->setReference('first_name')
->setLabelText(__('KMS::global.first_name')),
(new TextField())
->setReference('last_name')
->setLabelText(__('KMS::global.last_name')),
(new TextField())
->setReference('function')
->setLabelText(__('KMS::global.function')),
(new TextField())
->setReference('telephone_url')
->setLabelText(__('KMS::global.telephone_url')),
(new TextField())
->setReference('telephone_label')
->setLabelText(__('KMS::global.telephone_label')),
(new TextField())
->setReference('email')
->setLabelText(__('KMS::global.email')),
]);
}
}