File: D:/HostingSpaces/SBogers10/stielman.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;
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'),
]);
}
}