File: D:/HostingSpaces/SBogers10/eleo.komma.nl/app/Components/Types/Text.php
<?php
namespace App\Components\Types;
use App\Buttons\Kms\ButtonService;
use App\Buttons\Models\Button;
use Komma\KMS\Core\Attributes\MultiSelect;
use Komma\KMS\Components\ComponentType\Types\Text as KMSText;
use Komma\KMS\Core\Attributes\OnOff;
use Komma\KMS\Core\Attributes\Seperator;
use Komma\KMS\Core\Attributes\Title;
class Text extends KMSText
{
public function defineAttributesAndTabs()
{
parent::defineAttributesAndTabs();
$buttonsService = \App::make(ButtonService::class);
$selectOptions = $buttonsService->getOptionsForSelect(false, true);
$this->addItems([
(new MultiSelect())
->setLabelText('Knop')
->setMaxItemsToSelect(1)
->setItems($selectOptions->toArray())
->canBeLinkedWith(Button::class)
->setReference( 'buttons'),
(new Seperator()),
(new Title())
->setLabelText(__('KMS::attributes/components.options')),
(new OnOff())
->setLabelText('Maak rij \'Licht op donker\'')
->setReference( 'lightOnDark'),
]);
}
}