Add industry and text slide sections to homepage settings: introduce new fields in HomeSettings, update form structure in HomePageSettings, and modify homepage view to display dynamic content for industry and text slide areas.
This commit is contained in:
@@ -8,6 +8,7 @@ use Filament\Forms\Components\Section;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Forms\Components\Textarea;
|
||||
use Filament\Forms\Components\FileUpload;
|
||||
use Filament\Forms\Components\Repeater;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Pages\Page;
|
||||
use Filament\Pages\SettingsPage;
|
||||
@@ -62,8 +63,7 @@ class HomePageSettings extends SettingsPage
|
||||
->maxLength(255),
|
||||
Textarea::make('about_paragraph')
|
||||
->label('About Paragraph')
|
||||
->rows(5)
|
||||
->maxLength(65535),
|
||||
->rows(5) ->maxLength(65535),
|
||||
Grid::make()->schema([
|
||||
TextInput::make('about_projects_text')
|
||||
->label('Projects Text')
|
||||
@@ -130,6 +130,110 @@ class HomePageSettings extends SettingsPage
|
||||
->maxLength(255)
|
||||
->url(),
|
||||
]),
|
||||
|
||||
Section::make('Industry Area')
|
||||
->description('Manage the content for the industry area section.')
|
||||
->icon('heroicon-o-building-office')
|
||||
->schema([
|
||||
TextInput::make('industry_subtitle')
|
||||
->label('Subtitle')
|
||||
->maxLength(100),
|
||||
TextInput::make('industry_header')
|
||||
->label('Header')
|
||||
->required()
|
||||
->maxLength(255),
|
||||
Textarea::make('industry_paragraph')
|
||||
->label('Paragraph')
|
||||
->rows(3)
|
||||
->maxLength(65535),
|
||||
Grid::make()->schema([
|
||||
TextInput::make('industry_button_text')
|
||||
->label('Button Text')
|
||||
->maxLength(50),
|
||||
TextInput::make('industry_button_url')
|
||||
->label('Button URL')
|
||||
->maxLength(255)
|
||||
->url(),
|
||||
])->columns(2),
|
||||
FileUpload::make('industry_image_one')
|
||||
->label('Industry Image One (520x400)')
|
||||
->image()
|
||||
->maxSize(2048)
|
||||
->disk('public')
|
||||
->directory('industry-images'),
|
||||
Repeater::make('industry_items')
|
||||
->label('Industry Items')
|
||||
->schema([
|
||||
FileUpload::make('icon')
|
||||
->label('Icon (SVG)')
|
||||
->directory('industry-icons')
|
||||
->acceptedFileTypes(['image/svg+xml'])
|
||||
->maxSize(1024) // 1MB
|
||||
->required(),
|
||||
TextInput::make('title')
|
||||
->label('Title')
|
||||
->required()
|
||||
->maxLength(100),
|
||||
Textarea::make('description')
|
||||
->label('Description')
|
||||
->rows(2)
|
||||
->maxLength(255),
|
||||
])
|
||||
->columns(2)
|
||||
->minItems(1)
|
||||
->maxItems(5)
|
||||
->defaultItems(2)
|
||||
->reorderable()
|
||||
->collapsible(),
|
||||
]),
|
||||
|
||||
Section::make('Text Slide Area')
|
||||
->description('Manage the content for the text slide area section.')
|
||||
->icon('heroicon-o-chat-bubble-bottom-center-text')
|
||||
->schema([
|
||||
TextInput::make('text_slide_subtitle')
|
||||
->label('Subtitle')
|
||||
->maxLength(100),
|
||||
TextInput::make('text_slide_header')
|
||||
->label('Header')
|
||||
->required()
|
||||
->maxLength(255),
|
||||
FileUpload::make('text_slide_image')
|
||||
->label('Text Slide Image (540x350)')
|
||||
->image()
|
||||
->maxSize(2048)
|
||||
->disk('public')
|
||||
->directory('text-slide-images'),
|
||||
TextInput::make('text_slide_counter_number')
|
||||
->label('Counter Number')
|
||||
->numeric()
|
||||
->default(29),
|
||||
Repeater::make('text_slide_items')
|
||||
->label('Text Slide Items')
|
||||
->schema([
|
||||
FileUpload::make('icon')
|
||||
->label('Icon (SVG)')
|
||||
->directory('text-slide-icons')
|
||||
->acceptedFileTypes(['image/svg+xml'])
|
||||
->maxSize(1024) // 1MB
|
||||
->required(),
|
||||
TextInput::make('link')
|
||||
->label('Link')
|
||||
->required()
|
||||
->url()
|
||||
->maxLength(255),
|
||||
TextInput::make('text')
|
||||
->label('Text')
|
||||
->required()
|
||||
->maxLength(100),
|
||||
])
|
||||
->columns(3)
|
||||
->minItems(1)
|
||||
->maxItems(10)
|
||||
->defaultItems(6)
|
||||
->reorderable()
|
||||
->collapsible(),
|
||||
]),
|
||||
])
|
||||
->columns(1)
|
||||
->statePath('data');
|
||||
|
||||
@@ -44,6 +44,30 @@ class HomeSettings extends Settings
|
||||
|
||||
public string $about_image_two;
|
||||
|
||||
public string $industry_subtitle;
|
||||
|
||||
public string $industry_header;
|
||||
|
||||
public string $industry_paragraph;
|
||||
|
||||
public string $industry_button_text;
|
||||
|
||||
public string $industry_button_url;
|
||||
|
||||
public string $industry_image_one;
|
||||
|
||||
public array $industry_items;
|
||||
|
||||
public string $text_slide_subtitle;
|
||||
|
||||
public string $text_slide_header;
|
||||
|
||||
public string $text_slide_image;
|
||||
|
||||
public int $text_slide_counter_number;
|
||||
|
||||
public array $text_slide_items;
|
||||
|
||||
public static function group(): string
|
||||
{
|
||||
return 'cms_homepage';
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
use Spatie\LaravelSettings\Migrations\SettingsMigration;
|
||||
|
||||
return new class extends SettingsMigration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
$this->migrator->add('cms_homepage.industry_subtitle', 'Industry Certifications');
|
||||
$this->migrator->add('cms_homepage.industry_header', 'We Drive Client Success with Creative Building Designs');
|
||||
$this->migrator->add('cms_homepage.industry_paragraph', 'At BuildGo, we pride ourselves on transforming our clients\' visions into reality. Our innovative and client-focused designs ensure that every project stands out.');
|
||||
$this->migrator->add('cms_homepage.industry_button_text', 'Contact Us');
|
||||
$this->migrator->add('cms_homepage.industry_button_url', 'contact.html');
|
||||
$this->migrator->add('cms_homepage.industry_image_one', 'page/image-2.jpg');
|
||||
$this->migrator->add('cms_homepage.industry_items', [
|
||||
['icon' => 'icon/icon-3.svg', 'title' => 'Custom Designs', 'description' => 'Tailored building solutions that reflect your vision style'],
|
||||
['icon' => 'icon/icon-2.svg', 'title' => 'Interior Plans', 'description' => 'Creating aesthetically pleasing functional interior spaces'],
|
||||
]);
|
||||
|
||||
$this->migrator->add('cms_homepage.text_slide_subtitle', 'Construction design');
|
||||
$this->migrator->add('cms_homepage.text_slide_header', 'Digital Consulting The Key to Smarter Building');
|
||||
$this->migrator->add('cms_homepage.text_slide_image', 'page/cta.jpg');
|
||||
$this->migrator->add('cms_homepage.text_slide_counter_number', 29);
|
||||
$this->migrator->add('cms_homepage.text_slide_items', [
|
||||
['icon' => 'icon/star-dark.svg', 'link' => 'portfolio-details', 'text' => 'Residential'],
|
||||
['icon' => 'icon/star-dark.svg', 'link' => 'portfolio-details', 'text' => 'Architecture'],
|
||||
['icon' => 'icon/star-dark.svg', 'link' => 'portfolio-details', 'text' => 'Community'],
|
||||
['icon' => 'icon/star-dark.svg', 'link' => 'portfolio-details', 'text' => 'Healthcare'],
|
||||
['icon' => 'icon/star-dark.svg', 'link' => 'portfolio-details', 'text' => 'Seaside Resort'],
|
||||
['icon' => 'icon/star-dark.svg', 'link' => 'portfolio-details', 'text' => 'Modern'],
|
||||
]);
|
||||
}
|
||||
};
|
||||
@@ -240,32 +240,27 @@
|
||||
<div class="row al-center">
|
||||
<div class="col-lg-6 lg-mb-30">
|
||||
<div class="industry__four-left">
|
||||
<img class="lg_img_full wow img_top_animation" src="/web/assets/img/page/image-2.jpg" alt="image">
|
||||
<img class="lg_img_full wow img_top_animation" src="/storage/{{ $homeSettings->industry_image_one }}" alt="image">
|
||||
<div class="row mt-40">
|
||||
<div class="col-md-6 md-mb-25 wow fadeInUp" data-wow-delay=".4s">
|
||||
<div class="industry__four-left-item borders pr-10 lg-pr-0">
|
||||
<img src="/web/assets/img/icon/icon-3.svg" alt="image">
|
||||
<h5>Custom Designs</h5>
|
||||
<p>Tailored building solutions that reflect your vision style</p>
|
||||
@foreach($homeSettings->industry_items as $item)
|
||||
<div class="col-md-6 md-mb-25 wow fadeInUp" data-wow-delay=".4s">
|
||||
<div class="industry__four-left-item borders pr-10 lg-pr-0">
|
||||
<img src="/web/assets/img/icon/{{ $item['icon'] }}" alt="image">
|
||||
<h5>{{ $item['title'] }}</h5>
|
||||
<p>{{ $item['description'] }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6 wow fadeInUp" data-wow-delay=".8s">
|
||||
<div class="industry__four-left-item pl-20 xl-pl-0">
|
||||
<img src="/web/assets/img/icon/icon-2.svg" alt="image">
|
||||
<h5>Interior Plans</h5>
|
||||
<p>Creating aesthetically pleasing functional interior spaces</p>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
<div class="industry__four-right ml-45 xl-ml-0">
|
||||
<span class="subtitle wow fadeInLeft" data-wow-delay=".4s">Industry Certifications</span>
|
||||
<h2 class="title_split_anim mb-20">We Drive Client Success with Creative Building Designs</h2>
|
||||
<p class="wow fadeInUp" data-wow-delay=".4s">At BuildGo, we pride ourselves on transforming our clients' visions into reality. Our innovative and client-focused designs ensure that every project stands out.</p>
|
||||
<span class="subtitle wow fadeInLeft" data-wow-delay=".4s">{{ $homeSettings->industry_subtitle }}</span>
|
||||
<h2 class="title_split_anim mb-20">{{ $homeSettings->industry_header }}</h2>
|
||||
<p class="wow fadeInUp" data-wow-delay=".4s">{{ $homeSettings->industry_paragraph }}</p>
|
||||
<div class="item_bounce">
|
||||
<a class="build_button mt-25" href="contact.html">Contact Us<i class="flaticon-right-up"></i></a>
|
||||
<a class="build_button mt-25" href="{{ $homeSettings->industry_button_url }}">{{ $homeSettings->industry_button_text }}<i class="flaticon-right-up"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -279,15 +274,15 @@
|
||||
<div class="row">
|
||||
<div class="col-lg-6 lg-mb-30">
|
||||
<div class="text__slide-title mt-35 lg-mt-0">
|
||||
<span class="subtitle wow fadeInLeft" data-wow-delay=".4s">Construction design</span>
|
||||
<h2 class="title_split_anim">Digital Consulting The Key to Smarter Building</h2>
|
||||
<span class="subtitle wow fadeInLeft" data-wow-delay=".4s">{{ $homeSettings->text_slide_subtitle }}</span>
|
||||
<h2 class="title_split_anim">{{ $homeSettings->text_slide_header }}</h2>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
<div class="text__slide-right">
|
||||
<img class="wow img_left_animation" src="/web/assets/img/page/cta.jpg" alt="image">
|
||||
<img class="wow img_left_animation" src="/storage/{{ $homeSettings->text_slide_image }}" alt="image">
|
||||
<div class="text__slide-right-counter item_bounce" style="background-image: url('/web/assets/img/shape/content-1.png');">
|
||||
<h2><span class="counter">29</span>+</h2>
|
||||
<h2><span class="counter">{{ $homeSettings->text_slide_counter_number }}</span>+</h2>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -297,22 +292,16 @@
|
||||
<div class="text-slide">
|
||||
<div class="sliders text_scroll">
|
||||
<ul>
|
||||
<li><img src="/web/assets/img/icon/star-dark.svg" alt="icon"><a href="portfolio-details">Residential</a></li>
|
||||
<li><img src="/web/assets/img/icon/star-dark.svg" alt="icon"><a href="portfolio-details">Architecture</a></li>
|
||||
<li><img src="/web/assets/img/icon/star-dark.svg" alt="icon"><a href="portfolio-details">Community</a></li>
|
||||
<li><img src="/web/assets/img/icon/star-dark.svg" alt="icon"><a href="portfolio-details">Healthcare</a></li>
|
||||
<li><img src="/web/assets/img/icon/star-dark.svg" alt="icon"><a href="portfolio-details">Seaside Resort</a></li>
|
||||
<li><img src="/web/assets/img/icon/star-dark.svg" alt="icon"><a href="portfolio-details">Modern</a></li>
|
||||
@foreach($homeSettings->text_slide_items as $item)
|
||||
<li><img src="/web/assets/img/icon/{{ $item['icon'] }}" alt="icon"><a href="{{ $item['link'] }}">{{ $item['text'] }}</a></li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
<div class="sliders text_scroll">
|
||||
<ul>
|
||||
<li><img src="/web/assets/img/icon/star-dark.svg" alt="icon"><a href="portfolio-details">Residential</a></li>
|
||||
<li><img src="/web/assets/img/icon/star-dark.svg" alt="icon"><a href="portfolio-details">Architecture</a></li>
|
||||
<li><img src="/web/assets/img/icon/star-dark.svg" alt="icon"><a href="portfolio-details">Community</a></li>
|
||||
<li><img src="/web/assets/img/icon/star-dark.svg" alt="icon"><a href="portfolio-details">Healthcare</a></li>
|
||||
<li><img src="/web/assets/img/icon/star-dark.svg" alt="icon"><a href="portfolio-details">Seaside Resort</a></li>
|
||||
<li><img src="/web/assets/img/icon/star-dark.svg" alt="icon"><a href="portfolio-details">Modern</a></li>
|
||||
@foreach($homeSettings->text_slide_items as $item)
|
||||
<li><img src="/web/assets/img/icon/{{ $item['icon'] }}" alt="icon"><a href="{{ $item['link'] }}">{{ $item['text'] }}</a></li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user