10-04-2026
This commit is contained in:
parent
4d6b4930b2
commit
4bb89aad8c
836 changed files with 52961 additions and 5950 deletions
|
|
@ -10,8 +10,7 @@ class AboutHero extends Component
|
|||
|
||||
public function mount()
|
||||
{
|
||||
$theme = config('app.theme', 'b2in');
|
||||
$this->content = config("content.themes.{$theme}.about_hero", []);
|
||||
$this->content = cms_theme_section('about_hero');
|
||||
}
|
||||
|
||||
public function render()
|
||||
|
|
|
|||
|
|
@ -7,8 +7,11 @@ use Livewire\Component;
|
|||
class BenefitsSection extends Component
|
||||
{
|
||||
public $content = [];
|
||||
|
||||
public $layout = 'left'; // Standard-Layout
|
||||
|
||||
public $bg = 'bg-background';
|
||||
|
||||
public $section = 'card_section';
|
||||
|
||||
public function mount($layout = 'left', $bg = 'bg-background', $section = 'card_section')
|
||||
|
|
@ -16,11 +19,9 @@ class BenefitsSection extends Component
|
|||
$this->layout = $layout;
|
||||
$this->bg = $bg;
|
||||
$this->section = $section;
|
||||
$theme = config('app.theme', 'b2in');
|
||||
$this->content = config("content.themes.{$theme}.{$this->section}", []);
|
||||
$this->content = cms_theme_section($this->section);
|
||||
}
|
||||
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.web.components.sections.benefits-section');
|
||||
|
|
|
|||
|
|
@ -7,14 +7,16 @@ use Livewire\Component;
|
|||
class BrandWorlds extends Component
|
||||
{
|
||||
public $title;
|
||||
|
||||
public $subtitle;
|
||||
|
||||
public $worlds = [];
|
||||
|
||||
public $bg = 'bg-background';
|
||||
|
||||
public function mount($bg = 'bg-background')
|
||||
{
|
||||
$theme = config('app.theme', 'b2in');
|
||||
$content = config("content.themes.{$theme}.brand_worlds");
|
||||
$content = cms_theme_section('brand_worlds');
|
||||
|
||||
$this->title = $content['title'] ?? '';
|
||||
$this->subtitle = $content['subtitle'] ?? '';
|
||||
|
|
|
|||
|
|
@ -10,8 +10,7 @@ class BrokerSection extends Component
|
|||
|
||||
public function mount()
|
||||
{
|
||||
$theme = config('app.theme', 'b2in');
|
||||
$this->content = config("content.themes.{$theme}.broker_section", []);
|
||||
$this->content = cms_theme_section('broker_section');
|
||||
}
|
||||
|
||||
public function render()
|
||||
|
|
|
|||
|
|
@ -7,14 +7,15 @@ use Livewire\Component;
|
|||
class CTASection extends Component
|
||||
{
|
||||
public $content = [];
|
||||
|
||||
public $bg = '';
|
||||
|
||||
public $section = '';
|
||||
|
||||
public function mount($bg = 'bg-secondary', $section = 'cta_section')
|
||||
{
|
||||
$this->section = $section;
|
||||
$theme = config('app.theme', 'b2in');
|
||||
$this->content = config("content.themes.{$theme}.{$this->section}", []);
|
||||
$this->content = cms_theme_section($this->section);
|
||||
$this->bg = $bg;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,8 +7,11 @@ use Livewire\Component;
|
|||
class CardSection extends Component
|
||||
{
|
||||
public $content = [];
|
||||
|
||||
public $layout = 'left'; // Standard-Layout
|
||||
|
||||
public $bg = 'bg-background';
|
||||
|
||||
public $section = 'card_section';
|
||||
|
||||
public function mount($layout = 'left', $bg = 'bg-background', $section = 'card_section')
|
||||
|
|
@ -16,8 +19,7 @@ class CardSection extends Component
|
|||
$this->layout = $layout;
|
||||
$this->bg = $bg;
|
||||
$this->section = $section;
|
||||
$theme = config('app.theme', 'b2in');
|
||||
$this->content = config("content.themes.{$theme}.{$this->section}", []);
|
||||
$this->content = cms_theme_section($this->section);
|
||||
}
|
||||
|
||||
public function render()
|
||||
|
|
|
|||
|
|
@ -10,8 +10,7 @@ class CommitmentSection extends Component
|
|||
|
||||
public function mount()
|
||||
{
|
||||
$theme = config('app.theme', 'b2in');
|
||||
$this->content = config("content.themes.{$theme}.commitment_section", []);
|
||||
$this->content = cms_theme_section('commitment_section');
|
||||
}
|
||||
|
||||
public function render()
|
||||
|
|
|
|||
|
|
@ -7,8 +7,11 @@ use Livewire\Component;
|
|||
class ContentSection extends Component
|
||||
{
|
||||
public $content = [];
|
||||
|
||||
public $layout = 'left'; // Standard-Layout
|
||||
|
||||
public $bg = 'bg-background';
|
||||
|
||||
public $section = 'content_section_left';
|
||||
|
||||
public function mount($layout = 'left', $bg = 'bg-background', $section = 'content_section')
|
||||
|
|
@ -16,8 +19,7 @@ class ContentSection extends Component
|
|||
$this->layout = $layout;
|
||||
$this->bg = $bg;
|
||||
$this->section = $section;
|
||||
$theme = config('app.theme', 'b2in');
|
||||
$this->content = config("content.themes.{$theme}.{$this->section}", []);
|
||||
$this->content = cms_theme_section($this->section);
|
||||
}
|
||||
|
||||
public function render()
|
||||
|
|
|
|||
|
|
@ -10,8 +10,7 @@ class DarkStatsSection extends Component
|
|||
|
||||
public function mount()
|
||||
{
|
||||
$theme = config('app.theme', 'b2in');
|
||||
$this->content = config("content.themes.{$theme}.dark_stats_section", []);
|
||||
$this->content = cms_theme_section('dark_stats_section');
|
||||
}
|
||||
|
||||
public function render()
|
||||
|
|
|
|||
|
|
@ -10,8 +10,7 @@ class DigitalCore extends Component
|
|||
|
||||
public function mount()
|
||||
{
|
||||
$theme = config('app.theme', 'b2in');
|
||||
$this->content = config("content.themes.{$theme}.digital_core", []);
|
||||
$this->content = cms_theme_section('digital_core');
|
||||
}
|
||||
|
||||
public function render()
|
||||
|
|
|
|||
|
|
@ -7,7 +7,9 @@ use Livewire\Component;
|
|||
class EcosystemCore extends Component
|
||||
{
|
||||
public $content = [];
|
||||
|
||||
public $bg = 'bg-background';
|
||||
|
||||
public $section = 'ecosystem_core';
|
||||
|
||||
public function mount($bg = 'bg-background', $section = 'ecosystem_core')
|
||||
|
|
@ -15,8 +17,7 @@ class EcosystemCore extends Component
|
|||
$this->bg = $bg;
|
||||
$this->section = $section;
|
||||
|
||||
$theme = config('app.theme', 'b2in');
|
||||
$this->content = config("content.themes.{$theme}.{$this->section}", []);
|
||||
$this->content = cms_theme_section($this->section);
|
||||
}
|
||||
|
||||
public function render()
|
||||
|
|
|
|||
|
|
@ -10,12 +10,11 @@ class EcosystemHero extends Component
|
|||
|
||||
public function mount()
|
||||
{
|
||||
$theme = config('app.theme', 'b2in');
|
||||
$this->content = config("content.themes.{$theme}.ecosystem_hero", []);
|
||||
$this->content = cms_theme_section('ecosystem_hero');
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.web.components.sections.ecosystem-hero');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,8 +10,7 @@ class EcosystemStats extends Component
|
|||
|
||||
public function mount()
|
||||
{
|
||||
$theme = config('app.theme', 'b2in');
|
||||
$this->content = config("content.themes.{$theme}.ecosystem_stats", []);
|
||||
$this->content = cms_theme_section('ecosystem_stats');
|
||||
}
|
||||
|
||||
public function render()
|
||||
|
|
|
|||
|
|
@ -7,15 +7,16 @@ use Livewire\Component;
|
|||
class EndCustomerSection extends Component
|
||||
{
|
||||
public $content = [];
|
||||
|
||||
public $bg = '';
|
||||
|
||||
public $section = '';
|
||||
|
||||
public function mount($bg = 'bg-accent', $section = 'end_customer_section')
|
||||
{
|
||||
$theme = config('app.theme', 'b2in');
|
||||
$this->section = $section;
|
||||
$this->bg = $bg;
|
||||
$this->content = config("content.themes.{$theme}.end_customer_section", []);
|
||||
$this->content = cms_theme_section('end_customer_section');
|
||||
}
|
||||
|
||||
public function render()
|
||||
|
|
|
|||
|
|
@ -7,7 +7,9 @@ use Livewire\Component;
|
|||
class FAQ extends Component
|
||||
{
|
||||
public $content = [];
|
||||
|
||||
public $bg = '';
|
||||
|
||||
public $section = '';
|
||||
|
||||
public function mount($bg = 'bg-background', $section = 'faq')
|
||||
|
|
@ -15,8 +17,7 @@ class FAQ extends Component
|
|||
$this->bg = $bg;
|
||||
$this->section = $section;
|
||||
|
||||
$theme = config('app.theme', 'b2in');
|
||||
$this->content = config("content.themes.{$theme}.{$this->section}", []);
|
||||
$this->content = cms_theme_section($this->section);
|
||||
}
|
||||
|
||||
public function render()
|
||||
|
|
|
|||
|
|
@ -10,8 +10,7 @@ class FinalCommitment extends Component
|
|||
|
||||
public function mount()
|
||||
{
|
||||
$theme = config('app.theme', 'b2in');
|
||||
$this->content = config("content.themes.{$theme}.final_commitment", []);
|
||||
$this->content = cms_theme_section('final_commitment');
|
||||
}
|
||||
|
||||
public function render()
|
||||
|
|
|
|||
20
app/Livewire/Web/Components/Sections/FounderBar.php
Normal file
20
app/Livewire/Web/Components/Sections/FounderBar.php
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
<?php
|
||||
|
||||
namespace App\Livewire\Web\Components\Sections;
|
||||
|
||||
use Livewire\Component;
|
||||
|
||||
class FounderBar extends Component
|
||||
{
|
||||
public array $content = [];
|
||||
|
||||
public function mount(): void
|
||||
{
|
||||
$this->content = cms_theme_section('founder_bar');
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.web.components.sections.founder-bar');
|
||||
}
|
||||
}
|
||||
|
|
@ -10,8 +10,7 @@ class Hero extends Component
|
|||
|
||||
public function mount()
|
||||
{
|
||||
$theme = config('app.theme', 'b2in');
|
||||
$this->content = config("content.themes.{$theme}.hero", []);
|
||||
$this->content = cms_theme_section('hero');
|
||||
}
|
||||
|
||||
public function render()
|
||||
|
|
|
|||
|
|
@ -10,8 +10,7 @@ class HeroImage extends Component
|
|||
|
||||
public function mount()
|
||||
{
|
||||
$theme = config('app.theme', 'b2in');
|
||||
$this->content = config("content.themes.{$theme}.hero_image", []);
|
||||
$this->content = cms_theme_section('hero_image');
|
||||
}
|
||||
|
||||
public function render()
|
||||
|
|
|
|||
|
|
@ -7,24 +7,24 @@ use Livewire\Component;
|
|||
class HeroSlider extends Component
|
||||
{
|
||||
public $content = [];
|
||||
|
||||
public $currentSlide = 0;
|
||||
|
||||
public function mount()
|
||||
{
|
||||
$theme = config('app.theme', 'b2in');
|
||||
$this->content = config("content.themes.{$theme}.hero_slider", []);
|
||||
$this->content = cms_theme_section('hero_slider');
|
||||
}
|
||||
|
||||
public function nextSlide()
|
||||
{
|
||||
if (!empty($this->content['slides'])) {
|
||||
if (! empty($this->content['slides'])) {
|
||||
$this->currentSlide = ($this->currentSlide + 1) % count($this->content['slides']);
|
||||
}
|
||||
}
|
||||
|
||||
public function previousSlide()
|
||||
{
|
||||
if (!empty($this->content['slides'])) {
|
||||
if (! empty($this->content['slides'])) {
|
||||
$totalSlides = count($this->content['slides']);
|
||||
$this->currentSlide = ($this->currentSlide - 1 + $totalSlides) % $totalSlides;
|
||||
}
|
||||
|
|
@ -32,7 +32,7 @@ class HeroSlider extends Component
|
|||
|
||||
public function setSlide($index)
|
||||
{
|
||||
if (!empty($this->content['slides']) && $index >= 0 && $index < count($this->content['slides'])) {
|
||||
if (! empty($this->content['slides']) && $index >= 0 && $index < count($this->content['slides'])) {
|
||||
$this->currentSlide = $index;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,8 +10,7 @@ class HeroTiles extends Component
|
|||
|
||||
public function mount()
|
||||
{
|
||||
$theme = config('app.theme', 'b2in');
|
||||
$this->content = config("content.themes.{$theme}.hero_tiles", []);
|
||||
$this->content = cms_theme_section('hero_tiles');
|
||||
}
|
||||
|
||||
public function render()
|
||||
|
|
|
|||
23
app/Livewire/Web/Components/Sections/ImageBreak.php
Normal file
23
app/Livewire/Web/Components/Sections/ImageBreak.php
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
<?php
|
||||
|
||||
namespace App\Livewire\Web\Components\Sections;
|
||||
|
||||
use Livewire\Component;
|
||||
|
||||
class ImageBreak extends Component
|
||||
{
|
||||
public array $content = [];
|
||||
|
||||
public string $section = 'about_image_break';
|
||||
|
||||
public function mount(string $section = 'about_image_break'): void
|
||||
{
|
||||
$this->section = $section;
|
||||
$this->content = cms_theme_section($this->section);
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.web.components.sections.image-break');
|
||||
}
|
||||
}
|
||||
100
app/Livewire/Web/Components/Sections/ImmobilienContactForm.php
Normal file
100
app/Livewire/Web/Components/Sections/ImmobilienContactForm.php
Normal file
|
|
@ -0,0 +1,100 @@
|
|||
<?php
|
||||
|
||||
namespace App\Livewire\Web\Components\Sections;
|
||||
|
||||
use Acme\ContactForm\ContactFormService;
|
||||
use Acme\ContactForm\SpamDetector;
|
||||
use Livewire\Component;
|
||||
|
||||
class ImmobilienContactForm extends Component
|
||||
{
|
||||
public string $projectSlug = '';
|
||||
|
||||
public string $projectTitle = '';
|
||||
|
||||
/** @var array<string, string> */
|
||||
public array $interestOptions = [];
|
||||
|
||||
public string $interest = '';
|
||||
|
||||
public string $firstName = '';
|
||||
|
||||
public string $lastName = '';
|
||||
|
||||
public string $email = '';
|
||||
|
||||
public string $phone = '';
|
||||
|
||||
public string $message = '';
|
||||
|
||||
public bool $privacy = false;
|
||||
|
||||
public bool $success = false;
|
||||
|
||||
/** @var string Hidden honeypot field */
|
||||
public string $website = '';
|
||||
|
||||
public ?int $formLoadedAt = null;
|
||||
|
||||
/**
|
||||
* @param array<string, string> $interestOptions
|
||||
*/
|
||||
public function mount(string $projectSlug = '', string $projectTitle = '', array $interestOptions = []): void
|
||||
{
|
||||
$this->projectSlug = $projectSlug;
|
||||
$this->projectTitle = $projectTitle;
|
||||
$this->interestOptions = $interestOptions;
|
||||
$this->formLoadedAt = time();
|
||||
}
|
||||
|
||||
public function submit(ContactFormService $service): void
|
||||
{
|
||||
$this->validate([
|
||||
'firstName' => ['required', 'string', 'max:255'],
|
||||
'lastName' => ['required', 'string', 'max:255'],
|
||||
'email' => ['required', 'email:rfc', 'max:255'],
|
||||
'phone' => ['nullable', 'string', 'max:80'],
|
||||
'interest' => ['nullable', 'string', 'max:255'],
|
||||
'message' => ['nullable', 'string', 'max:2000'],
|
||||
'privacy' => ['accepted'],
|
||||
'website' => ['nullable', 'string', 'max:0'],
|
||||
]);
|
||||
|
||||
$spamDetector = SpamDetector::fromConfig();
|
||||
$payload = [
|
||||
'project' => $this->projectSlug,
|
||||
'project_title' => $this->projectTitle,
|
||||
'interest' => $this->interest,
|
||||
'first_name' => $this->firstName,
|
||||
'last_name' => $this->lastName,
|
||||
'email' => $this->email,
|
||||
'phone' => $this->phone,
|
||||
'message' => $this->message,
|
||||
'website' => $this->website,
|
||||
'ip' => request()->ip(),
|
||||
'user_agent' => request()->userAgent(),
|
||||
'is_spam' => false,
|
||||
];
|
||||
|
||||
$payload['is_spam'] = $spamDetector->detect($payload, $this->formLoadedAt);
|
||||
|
||||
$subject = 'Immobilien-Anfrage: '.($this->projectTitle ?: $this->projectSlug);
|
||||
$service->handle($payload, $subject, 'immobilien-contact-form');
|
||||
|
||||
$this->success = true;
|
||||
$this->interest = '';
|
||||
$this->firstName = '';
|
||||
$this->lastName = '';
|
||||
$this->email = '';
|
||||
$this->phone = '';
|
||||
$this->message = '';
|
||||
$this->privacy = false;
|
||||
$this->website = '';
|
||||
$this->formLoadedAt = time();
|
||||
}
|
||||
|
||||
public function render(): \Illuminate\View\View
|
||||
{
|
||||
return view('livewire.web.components.sections.immobilien-contact-form');
|
||||
}
|
||||
}
|
||||
|
|
@ -10,8 +10,7 @@ class LeadershipTeam extends Component
|
|||
|
||||
public function mount()
|
||||
{
|
||||
$theme = config('app.theme', 'b2in');
|
||||
$this->content = config("content.themes.{$theme}.leadership_team", []);
|
||||
$this->content = cms_theme_section('leadership_team');
|
||||
}
|
||||
|
||||
public function render()
|
||||
|
|
|
|||
|
|
@ -7,8 +7,11 @@ use Livewire\Component;
|
|||
class MagazinDetail extends Component
|
||||
{
|
||||
public $articleId;
|
||||
|
||||
public $article;
|
||||
|
||||
public $relatedArticles;
|
||||
|
||||
public $content;
|
||||
|
||||
public function mount($id = 1)
|
||||
|
|
@ -29,7 +32,7 @@ class MagazinDetail extends Component
|
|||
{
|
||||
$articles = $this->getArticlesData();
|
||||
$this->relatedArticles = collect($articles)
|
||||
->filter(fn($article, $key) => $key != $this->articleId)
|
||||
->filter(fn ($article, $key) => $key != $this->articleId)
|
||||
->take(2)
|
||||
->values()
|
||||
->toArray();
|
||||
|
|
@ -37,20 +40,19 @@ class MagazinDetail extends Component
|
|||
|
||||
private function loadThemeContent()
|
||||
{
|
||||
$theme = config('app.theme', 'b2in');
|
||||
$this->content = config("content.themes.{$theme}.magazin_detail", []);
|
||||
$this->content = cms_theme_section('magazin_detail');
|
||||
}
|
||||
|
||||
private function getArticlesData()
|
||||
{
|
||||
return config('content.articles', []);
|
||||
return trans('b2in.articles');
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.web.components.sections.magazin-detail', [
|
||||
'article' => $this->article,
|
||||
'relatedArticles' => $this->relatedArticles
|
||||
'relatedArticles' => $this->relatedArticles,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ use Livewire\Component;
|
|||
class MagazinList extends Component
|
||||
{
|
||||
public $posts = [];
|
||||
|
||||
public $content = [];
|
||||
|
||||
public function mount()
|
||||
|
|
@ -17,7 +18,7 @@ class MagazinList extends Component
|
|||
|
||||
private function loadPosts()
|
||||
{
|
||||
$articles = config('content.articles', []);
|
||||
$articles = trans('b2in.articles');
|
||||
$this->posts = collect($articles)->map(function ($article) {
|
||||
return [
|
||||
'id' => $article['id'],
|
||||
|
|
@ -32,8 +33,7 @@ class MagazinList extends Component
|
|||
|
||||
private function loadThemeContent()
|
||||
{
|
||||
$theme = config('app.theme', 'b2in');
|
||||
$this->content = config("content.themes.{$theme}.magazin_list", []);
|
||||
$this->content = cms_theme_section('magazin_list');
|
||||
}
|
||||
|
||||
public function render()
|
||||
|
|
|
|||
|
|
@ -10,8 +10,7 @@ class OurStory extends Component
|
|||
|
||||
public function mount()
|
||||
{
|
||||
$theme = config('app.theme', 'b2in');
|
||||
$this->content = config("content.themes.{$theme}.our_story", []);
|
||||
$this->content = cms_theme_section('our_story');
|
||||
}
|
||||
|
||||
public function render()
|
||||
|
|
|
|||
|
|
@ -10,8 +10,7 @@ class OurValues extends Component
|
|||
|
||||
public function mount()
|
||||
{
|
||||
$theme = config('app.theme', 'b2in');
|
||||
$this->content = config("content.themes.{$theme}.our_values", []);
|
||||
$this->content = cms_theme_section('our_values');
|
||||
}
|
||||
|
||||
public function render()
|
||||
|
|
|
|||
|
|
@ -10,8 +10,7 @@ class PartnerBenefits extends Component
|
|||
|
||||
public function mount()
|
||||
{
|
||||
$theme = config('app.theme', 'b2in');
|
||||
$this->content = config("content.themes.{$theme}.partner_benefits", []);
|
||||
$this->content = cms_theme_section('partner_benefits');
|
||||
}
|
||||
|
||||
public function render()
|
||||
|
|
|
|||
|
|
@ -7,14 +7,15 @@ use Livewire\Component;
|
|||
class PartnerCTA extends Component
|
||||
{
|
||||
public $content = [];
|
||||
|
||||
public $bg = '';
|
||||
|
||||
public $section = '';
|
||||
|
||||
public function mount($bg = 'bg-secondary', $section = 'partner_cta')
|
||||
{
|
||||
$this->section = $section;
|
||||
$theme = config('app.theme', 'b2in');
|
||||
$this->content = config("content.themes.{$theme}.{$this->section}", []);
|
||||
$this->content = cms_theme_section($this->section);
|
||||
$this->bg = $bg;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -28,20 +28,21 @@ class PartnerHero extends Component
|
|||
'icon' => 'award',
|
||||
],
|
||||
];
|
||||
|
||||
public $section = 'partner_hero';
|
||||
|
||||
public $content = [];
|
||||
|
||||
public function mount($section = 'partner_hero')
|
||||
{
|
||||
$this->section = $section;
|
||||
$theme = config('app.theme', 'b2in');
|
||||
$this->content = config("content.themes.{$theme}.{$this->section}", []);
|
||||
$this->content = cms_theme_section($this->section);
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.web.components.sections.partner-hero', [
|
||||
'partnerTypes' => $this->partnerTypes
|
||||
'partnerTypes' => $this->partnerTypes,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,8 +10,7 @@ class PartnerProcess extends Component
|
|||
|
||||
public function mount()
|
||||
{
|
||||
$theme = config('app.theme', 'b2in');
|
||||
$this->content = config("content.themes.{$theme}.partner_process", []);
|
||||
$this->content = cms_theme_section('partner_process');
|
||||
}
|
||||
|
||||
public function render()
|
||||
|
|
|
|||
|
|
@ -7,10 +7,15 @@ use Livewire\Component;
|
|||
class Portfolio extends Component
|
||||
{
|
||||
public string $activeFilter = 'alle';
|
||||
|
||||
public ?array $selectedProject = null;
|
||||
|
||||
public bool $showModal = false;
|
||||
|
||||
public $content = [];
|
||||
|
||||
public $theme = '';
|
||||
|
||||
public $filters = [];
|
||||
|
||||
public function mount()
|
||||
|
|
@ -19,13 +24,17 @@ class Portfolio extends Component
|
|||
'alle' => 'Alle',
|
||||
'villen' => 'Villen',
|
||||
'penthouse' => 'Penthouse',
|
||||
'loft' => 'Loft'
|
||||
'loft' => 'Loft',
|
||||
];
|
||||
$this->filters = $filters;
|
||||
$this->activeFilter = 'alle';
|
||||
$this->theme = config('app.theme', 'b2in');
|
||||
$this->content = config("content.themes.{$this->theme}.portfolio", []);
|
||||
$this->filters = config("content.themes.{$this->theme}.portfolio.filters", $filters);
|
||||
$portfolio = cms_theme_section('portfolio', $this->theme);
|
||||
if (! is_array($portfolio)) {
|
||||
$portfolio = [];
|
||||
}
|
||||
$this->content = $portfolio;
|
||||
$this->filters = $portfolio['filters'] ?? $filters;
|
||||
}
|
||||
|
||||
public function filterBy(string $category): void
|
||||
|
|
@ -47,8 +56,7 @@ class Portfolio extends Component
|
|||
|
||||
public function getFilteredProjects(): array
|
||||
{
|
||||
$projects = config("content.themes.{$this->theme}.portfolio.projects", []);
|
||||
|
||||
$projects = $this->content['projects'] ?? [];
|
||||
|
||||
if ($this->activeFilter === 'alle') {
|
||||
return $projects;
|
||||
|
|
|
|||
|
|
@ -10,8 +10,7 @@ class SpotlightsSection extends Component
|
|||
|
||||
public function mount()
|
||||
{
|
||||
$theme = config('app.theme', 'b2in');
|
||||
$this->content = config("content.themes.{$theme}.spotlights_section", []);
|
||||
$this->content = cms_theme_section('spotlights_section');
|
||||
}
|
||||
|
||||
public function render()
|
||||
|
|
|
|||
|
|
@ -10,8 +10,7 @@ class SupplierSection extends Component
|
|||
|
||||
public function mount()
|
||||
{
|
||||
$theme = config('app.theme', 'b2in');
|
||||
$this->content = config("content.themes.{$theme}.supplier_section", []);
|
||||
$this->content = cms_theme_section('supplier_section');
|
||||
}
|
||||
|
||||
public function render()
|
||||
|
|
|
|||
|
|
@ -7,13 +7,13 @@ use Livewire\Component;
|
|||
class VisionSection extends Component
|
||||
{
|
||||
public $content = [];
|
||||
|
||||
public $bg = 'bg-background';
|
||||
|
||||
public function mount($bg = 'bg-background')
|
||||
{
|
||||
$this->bg = $bg;
|
||||
$theme = config('app.theme', 'b2in');
|
||||
$this->content = config("content.themes.{$theme}.vision_section", []);
|
||||
$this->content = cms_theme_section('vision_section');
|
||||
}
|
||||
|
||||
public function render()
|
||||
|
|
|
|||
20
app/Livewire/Web/Components/UI/AnnouncementBar.php
Normal file
20
app/Livewire/Web/Components/UI/AnnouncementBar.php
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
<?php
|
||||
|
||||
namespace App\Livewire\Web\Components\Ui;
|
||||
|
||||
use Livewire\Component;
|
||||
|
||||
class AnnouncementBar extends Component
|
||||
{
|
||||
public array $content = [];
|
||||
|
||||
public function mount(): void
|
||||
{
|
||||
$this->content = cms_theme_section('announcement_bar');
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.web.components.ui.announcement-bar');
|
||||
}
|
||||
}
|
||||
|
|
@ -2,63 +2,113 @@
|
|||
|
||||
namespace App\Livewire\Web\Components\Ui;
|
||||
|
||||
use Acme\ContactForm\ContactFormService;
|
||||
use Acme\ContactForm\SpamDetector;
|
||||
use Livewire\Component;
|
||||
|
||||
class ContactForm extends Component
|
||||
{
|
||||
public $firstName = '';
|
||||
public $lastName = '';
|
||||
public $company = '';
|
||||
public $email = '';
|
||||
public $phone = '';
|
||||
public $subject = '';
|
||||
public $message = '';
|
||||
public string $firstName = '';
|
||||
|
||||
public $content = [];
|
||||
public string $lastName = '';
|
||||
|
||||
public function mount()
|
||||
public string $company = '';
|
||||
|
||||
public string $email = '';
|
||||
|
||||
public string $phone = '';
|
||||
|
||||
public string $subject = '';
|
||||
|
||||
public string $message = '';
|
||||
|
||||
public bool $privacy = false;
|
||||
|
||||
public bool $success = false;
|
||||
|
||||
/** @var string Hidden honeypot field */
|
||||
public string $website = '';
|
||||
|
||||
public ?int $formLoadedAt = null;
|
||||
|
||||
/** @var array<string, mixed> */
|
||||
public array $content = [];
|
||||
|
||||
public function mount(): void
|
||||
{
|
||||
$theme = config('app.theme', 'b2in');
|
||||
$this->content = config("content.themes.{$theme}.contact_form", []);
|
||||
$this->content = cms_theme_section('contact_form');
|
||||
$this->formLoadedAt = time();
|
||||
}
|
||||
|
||||
public function getSubjectsProperty()
|
||||
/** @return array<string, string> */
|
||||
public function getSubjectsProperty(): array
|
||||
{
|
||||
return $this->content['form']['subjects'] ?? [];
|
||||
}
|
||||
|
||||
public function getContactInfoProperty()
|
||||
/** @return array<int, array<string, mixed>> */
|
||||
public function getContactInfoProperty(): array
|
||||
{
|
||||
return $this->content['contact_info'] ?? [];
|
||||
}
|
||||
|
||||
public function getSocialMediaProperty()
|
||||
/** @return array<int, array<string, mixed>> */
|
||||
public function getSocialMediaProperty(): array
|
||||
{
|
||||
return $this->content['social_media']['platforms'] ?? [];
|
||||
}
|
||||
|
||||
public function submit()
|
||||
public function submit(ContactFormService $service): void
|
||||
{
|
||||
$this->validate([
|
||||
'firstName' => 'required|string|max:255',
|
||||
'lastName' => 'required|string|max:255',
|
||||
'email' => 'required|email|max:255',
|
||||
'subject' => 'required|string',
|
||||
'message' => 'required|string|max:2000',
|
||||
'company' => 'nullable|string|max:255',
|
||||
'phone' => 'nullable|string|max:255',
|
||||
'firstName' => ['required', 'string', 'max:255'],
|
||||
'lastName' => ['required', 'string', 'max:255'],
|
||||
'email' => ['required', 'email:rfc', 'max:255'],
|
||||
'subject' => ['required', 'string'],
|
||||
'message' => ['required', 'string', 'max:2000'],
|
||||
'company' => ['nullable', 'string', 'max:255'],
|
||||
'phone' => ['nullable', 'string', 'max:255'],
|
||||
'privacy' => ['accepted'],
|
||||
'website' => ['nullable', 'string', 'max:0'],
|
||||
]);
|
||||
|
||||
// Here you would typically save to database or send email
|
||||
// For now, we'll just show a success message
|
||||
$spamDetector = SpamDetector::fromConfig();
|
||||
$payload = [
|
||||
'first_name' => $this->firstName,
|
||||
'last_name' => $this->lastName,
|
||||
'email' => $this->email,
|
||||
'subject' => $this->subject,
|
||||
'message' => $this->message,
|
||||
'company' => $this->company,
|
||||
'phone' => $this->phone,
|
||||
'website' => $this->website,
|
||||
'ip' => request()->ip(),
|
||||
'user_agent' => request()->userAgent(),
|
||||
'is_spam' => false,
|
||||
];
|
||||
|
||||
$successMessage = $this->content['form']['success_message'] ?? 'Vielen Dank für Ihre Nachricht! Wir werden uns schnellstmöglich bei Ihnen melden.';
|
||||
session()->flash('message', $successMessage);
|
||||
$payload['is_spam'] = $spamDetector->detect($payload, $this->formLoadedAt);
|
||||
|
||||
$this->reset(['firstName', 'lastName', 'company', 'email', 'phone', 'subject', 'message']);
|
||||
$subjectLabel = $this->getSubjectsProperty()[$this->subject] ?? $this->subject;
|
||||
$subjectLine = $subjectLabel
|
||||
? 'Kontaktanfrage B2in: ' . $subjectLabel
|
||||
: __('contact-form::contact-form.default_subject');
|
||||
$service->handle($payload, $subjectLine, 'contact-form');
|
||||
|
||||
$this->success = true;
|
||||
$this->firstName = '';
|
||||
$this->lastName = '';
|
||||
$this->company = '';
|
||||
$this->email = '';
|
||||
$this->phone = '';
|
||||
$this->subject = '';
|
||||
$this->message = '';
|
||||
$this->privacy = false;
|
||||
$this->website = '';
|
||||
$this->formLoadedAt = time();
|
||||
}
|
||||
|
||||
public function render()
|
||||
public function render(): \Illuminate\View\View
|
||||
{
|
||||
return view('livewire.web.components.ui.contact-form');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,17 +10,20 @@ class Header extends Component
|
|||
public $domainName;
|
||||
public $domainUrl;
|
||||
public $content = [];
|
||||
public $currentLocale;
|
||||
public $availableLocales = [
|
||||
'de' => 'DE',
|
||||
'en' => 'EN',
|
||||
];
|
||||
|
||||
public function mount()
|
||||
public function mount(): void
|
||||
{
|
||||
$this->domainName = \App\Helpers\ThemeHelper::getDomainName();
|
||||
$this->domainUrl = \App\Helpers\ThemeHelper::getDomainUrl();
|
||||
$theme = config('app.theme', 'b2in');
|
||||
$this->content = config("content.themes.{$theme}.header", [
|
||||
'portal_login' => 'Portal Login',
|
||||
'navigation' => []
|
||||
]);
|
||||
|
||||
$this->currentLocale = app()->getLocale();
|
||||
|
||||
$this->content = cms_theme_section('header');
|
||||
|
||||
// Ensure required keys exist
|
||||
if (!isset($this->content['portal_login'])) {
|
||||
$this->content['portal_login'] = 'Portal Login';
|
||||
|
|
@ -30,12 +33,27 @@ class Header extends Component
|
|||
}
|
||||
}
|
||||
|
||||
public function toggleMobileMenu()
|
||||
public function switchLanguage(string $locale): mixed
|
||||
{
|
||||
if (array_key_exists($locale, $this->availableLocales)) {
|
||||
app()->setLocale($locale);
|
||||
session(['locale' => $locale]);
|
||||
$this->currentLocale = $locale;
|
||||
|
||||
$referer = request()->header('Referer') ?? '/';
|
||||
|
||||
return redirect()->to($referer);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public function toggleMobileMenu(): void
|
||||
{
|
||||
$this->isMobileMenuOpen = ! $this->isMobileMenuOpen;
|
||||
}
|
||||
|
||||
public function closeMobileMenu()
|
||||
public function closeMobileMenu(): void
|
||||
{
|
||||
$this->isMobileMenuOpen = false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue