File: D:/HostingSpaces/SBogers10/beat-the-barn.komma.nl/app/WebsiteConfig/WebsiteConfigSection.php
<?php
namespace App\WebsiteConfig;
use App\Buttons\Kms\ButtonService;
use Illuminate\Database\Eloquent\Model;
use Komma\KMS\Core\Attributes\MultiSelect;
use Komma\KMS\Core\Attributes\Seperator;
use Komma\KMS\Core\Attributes\TextField;
use Komma\KMS\Core\Attributes\Title;
use Komma\KMS\Core\Sections\Section;
use App\Servicepoints\Kms\ServicepointService;
use Komma\KMS\Users\Models\KmsUserRole;
class WebsiteConfigSection extends Section
{
public function defineAttributesAndTabs(Model $currentModel = null): void
{
$servicePointService = \App::make(ServicepointService::class);
$servicePointOptions = $servicePointService->getOptionsForSelect(false, true);
$buttonsService = \App::make(ButtonService::class);
$buttonModels = $buttonsService->getOptionsForSelect();
$this->tabs->makeTab()->addItems([
(new Title())
->setMinimumUserRole(KmsUserRole::Admin)
->setLabelText('Bedrijfsgegevens'),
(new TextField())
->setReference('company_url')
->setLabelText('Url'),
(new TextField())
->setReference('company_name')
->setLabelText('Bedrijfsnaam'),
(new TextField())
->setReference('company_address')
->setLabelText('Adres'),
(new TextField())
->setReference('company_zip')
->setLabelText('Postcode'),
(new TextField())
->setReference('company_city')
->setLabelText('Stad'),
(new TextField())
->setReference('company_country')
->setLabelText('Land'),
(new TextField())
->setReference('company_kvk')
->setLabelText('KVK'),
(new TextField())
->setReference('company_email')
->setLabelText('E-mail'),
(new TextField())
->setReference('company_phone_call')
->setLabelText('Telefoon link'),
(new TextField())
->setReference('company_phone_display')
->setLabelText('Telefoon weergave'),
(new TextField())
->setReference('company_mobile_call')
->setLabelText('Mobiele telefoon link'),
(new TextField())
->setReference('company_mobile_display')
->setLabelText('Mobiele telefoon weergave'),
(new Seperator()),
(new Title())
->setLabelText('Google Maps'),
(new TextField())
->setPlaceholderText('Ex. 51.257929')
->setReference('google_maps_lat')
->setLabelText('Latitude'),
(new TextField())
->setPlaceholderText('Ex. 5.595330')
->setReference('google_maps_long')
->setLabelText('Longitude'),
(new Seperator()),
(new Title())
->setLabelText('Sociale media'),
(new TextField())
->setReference('company_social_facebook')
->setLabelText('Facebook'),
(new TextField())
->setReference('company_social_linkedin')
->setLabelText('Linkedin'),
(new TextField())
->setReference('company_social_instagram')
->setLabelText('Instagram'),
(new TextField())
->setReference('company_social_twitter')
->setLabelText('Twitter'),
(new Seperator())
->setMinimumUserRole(KmsUserRole::SuperAdmin),
(new Title())
->setLabelText(__('KMS::global.defaultServicePoint'))
->setMinimumUserRole(KmsUserRole::SuperAdmin),
// (new TextField())
// ->setReference('global_servicePoint_heading')
// ->setLabelText(__('KMS::global.servicePointHeading'))
// ->setMinimumUserRole(KmsUserRole::SuperAdmin),
(new MultiSelect())
->setReference('global_servicePoint_id')
->setItems($servicePointOptions->toArray())
->setLabelText(__('KMS::servicepoints.entity'))
->setMaxItemsToSelect(1)
->setMinimumUserRole(KmsUserRole::SuperAdmin),
// (new MultiSelect())
// ->setReference('global_servicePoint_button_id')
// ->setItems($buttonModels->toArray())
// ->setMaxItemsToSelect(1)
// ->setLabelText(__('KMS::global.servicePointButton'))
// ->setMinimumUserRole(KmsUserRole::SuperAdmin),
(new Seperator())
->setMinimumUserRole(KmsUserRole::SuperAdmin),
]);
}
}