HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/SBogers10/shop.komma.nl/app/Servicepoints/Kms/Kms/ServicepointSection.php
<?php


namespace App\Servicepoints\Kms\Kms;

use Komma\KMS\Core\Attributes\Documents;
use Komma\KMS\Core\Attributes\Models\ImageProperty;
use Komma\KMS\Core\Attributes\OnOff;
use Komma\KMS\Core\Attributes\TextField;
use Illuminate\Database\Eloquent\Model;
use Komma\KMS\Core\Sections\Section;

final class ServicepointSection extends Section
{

    public function defineAttributesAndTabs(Model $currentModel = null): void
    {
        $this->tabs->makeTab()->addItems([

            (new OnOff())
                ->setLabelText(__('KMS::global.active'))
//            ->switchOn()
                ->setReference( 'active'),

            (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')),
        ]);
    }
}