File: D:/HostingSpaces/SBogers10/reiskick.komma.nl/app/WebsiteConfig/WebsiteConfigSection.php
<?php
namespace App\WebsiteConfig;
use App\Components\ComponentTypes;
use Illuminate\Database\Eloquent\Model;
use Komma\KMS\Core\Attributes\Attribute;
use Komma\KMS\Core\Attributes\ComponentArea;
use Komma\KMS\Core\Attributes\Documents;
use Komma\KMS\Core\Attributes\Models\ImageProperty;
use Komma\KMS\Core\Attributes\Seperator;
use Komma\KMS\Core\Attributes\TextArea;
use Komma\KMS\Core\Attributes\TextField;
use Komma\KMS\Core\Attributes\Title;
use Komma\KMS\Core\Sections\Section;
use Komma\KMS\Users\Models\KmsUserRole;
class WebsiteConfigSection extends Section
{
public function defineAttributesAndTabs(Model $currentModel = null): void
{
$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 Seperator()),
(new Title())
->setLabelText('Social media'),
(new TextField())
->setReference('company_social_facebook')
->setLabelText('Facebook'),
(new TextField())
->setReference('company_social_pinterest')
->setLabelText('Linkedin'),
(new TextField())
->setReference('company_social_instagram')
->setLabelText('Instagram'),
(new Seperator()),
(new Title())
->setLabelText('Instagram'),
(new Documents())
->setReference('company_social_instagram_photo')
->setLabelText('Instagram Foto')
->onlyAllowImages()
->setSmallDragAndDropArea()
->setMaxDocuments(1)
->setSubFolder('config')
->setImageProperties([
(new ImageProperty())->setName('small')->setCropMethod(ImageProperty::Resize)->setWidth(120),
]),
(new TextField())
->setReference('company_social_instagram_name')
->setLabelText('Instagram Naam'),
(new TextArea())
->setReference('company_social_instagram_line')
->setLabelText('Instagram Bio'),
(new Seperator()),
(new Title())
->setLabelText('Sidebar'),
]);
}
}