From 1b4989b4408e347cfcba6f872d3ed8af226e3d6f Mon Sep 17 00:00:00 2001 From: Nurmuhammet Allanov Date: Mon, 28 Jul 2025 20:33:38 +0500 Subject: [PATCH] Enhance solution management features: add title_description and bullets fields to SolutionResource, update OurSolutionPageController to fetch solutions in descending order, and create new views for displaying solutions with detailed descriptions and bullet points. Adjust CSS for active button styling and update navigation to reflect title instead of name for solutions. --- app/Filament/Resources/SolutionResource.php | 20 +++- .../Controllers/OurSolutionPageController.php | 2 +- app/Models/Solution.php | 6 + ...ription_and_bullets_to_solutions_table.php | 29 +++++ public/web/assets/css/style.css | 2 +- .../web/layouts/navigation/header.blade.php | 2 +- .../web/pages/our-solutions/index.blade.php | 51 +++++++++ .../web/pages/our-solutions/show.blade.php | 104 ++++++++++++++++++ 8 files changed, 212 insertions(+), 4 deletions(-) create mode 100644 database/migrations/2025_07_28_202649_add_title_description_and_bullets_to_solutions_table.php diff --git a/app/Filament/Resources/SolutionResource.php b/app/Filament/Resources/SolutionResource.php index bb9cab0..993cbeb 100644 --- a/app/Filament/Resources/SolutionResource.php +++ b/app/Filament/Resources/SolutionResource.php @@ -28,12 +28,30 @@ class SolutionResource extends Resource ->maxLength(255) ->reactive() ->afterStateUpdated(fn (string $operation, $state, Forms\Set $set) => $operation === 'create' ? $set('slug', Str::slug($state)) : null), - Forms\Components\TextInput::make('slug') + + Forms\Components\TextInput::make('slug') ->required() ->maxLength(255), + + Forms\Components\TextInput::make('title_description') + ->maxLength(255) + ->required() + ->columnSpanFull(), + + Forms\Components\Repeater::make('bullets') + ->schema([ + Forms\Components\TextInput::make('bullet') + ->label('Bullet Point') + ->required(), + ]) + ->columns(1) + ->columnSpanFull() + ->createItemButtonLabel('Add Bullet Point') + ->defaultItems(1), Forms\Components\RichEditor::make('description') ->required() ->columnSpanFull(), + ]); } diff --git a/app/Http/Controllers/OurSolutionPageController.php b/app/Http/Controllers/OurSolutionPageController.php index 8235e7b..1fe645e 100644 --- a/app/Http/Controllers/OurSolutionPageController.php +++ b/app/Http/Controllers/OurSolutionPageController.php @@ -8,7 +8,7 @@ class OurSolutionPageController extends Controller { public function index() { - $solutions = Solution::all(); + $solutions = Solution::query()->latest()->get(); return view('web.pages.our-solutions.index', compact('solutions')); } diff --git a/app/Models/Solution.php b/app/Models/Solution.php index b33d677..6e76606 100644 --- a/app/Models/Solution.php +++ b/app/Models/Solution.php @@ -13,5 +13,11 @@ class Solution extends Model 'title', 'description', 'slug', + 'title_description', + 'bullets', + ]; + + protected $casts = [ + 'bullets' => 'array', ]; } diff --git a/database/migrations/2025_07_28_202649_add_title_description_and_bullets_to_solutions_table.php b/database/migrations/2025_07_28_202649_add_title_description_and_bullets_to_solutions_table.php new file mode 100644 index 0000000..f62cb1d --- /dev/null +++ b/database/migrations/2025_07_28_202649_add_title_description_and_bullets_to_solutions_table.php @@ -0,0 +1,29 @@ +string('title_description')->nullable()->after('description'); + $table->json('bullets')->nullable()->after('title_description'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('solutions', function (Blueprint $table) { + $table->dropColumn(['title_description', 'bullets']); + }); + } +}; diff --git a/public/web/assets/css/style.css b/public/web/assets/css/style.css index 1a983bf..7833456 100644 --- a/public/web/assets/css/style.css +++ b/public/web/assets/css/style.css @@ -6695,7 +6695,7 @@ p { margin: 3px 3px 3px 3px; } .gallery__area-button button.active { - color: var(--color-1); + color: var(--text-white); background: var(--primary-color-1); border-color: var(--primary-color-1); } diff --git a/resources/views/web/layouts/navigation/header.blade.php b/resources/views/web/layouts/navigation/header.blade.php index e6e8ffd..fe430ca 100644 --- a/resources/views/web/layouts/navigation/header.blade.php +++ b/resources/views/web/layouts/navigation/header.blade.php @@ -21,7 +21,7 @@ diff --git a/resources/views/web/pages/our-solutions/index.blade.php b/resources/views/web/pages/our-solutions/index.blade.php index e69de29..fd27141 100644 --- a/resources/views/web/pages/our-solutions/index.blade.php +++ b/resources/views/web/pages/our-solutions/index.blade.php @@ -0,0 +1,51 @@ +@extends('web.layouts.app') + +@section('content') + + + + +
+
+
+
+ @foreach($solutions as $solution) +
+
+ {{ $solution->title_description }} +

{{ $solution->title }}

+
+
+
    + @foreach($solution->bullets as $bullet) + @isset($bullet['bullet']) +
  • {{ $bullet['bullet'] }}
  • + @endisset + @endforeach +
+
+
+ Read More +
+
+ @endforeach +
+
+
+
+ +@endsection \ No newline at end of file diff --git a/resources/views/web/pages/our-solutions/show.blade.php b/resources/views/web/pages/our-solutions/show.blade.php index e69de29..0207b34 100644 --- a/resources/views/web/pages/our-solutions/show.blade.php +++ b/resources/views/web/pages/our-solutions/show.blade.php @@ -0,0 +1,104 @@ +@extends('web.layouts.app') + +@section('content') + + + + +
+
+
+
+
+ +
+

Ready for Your Next Construction?

+ Get an Advice +
+
+

Download

+ +
+
+
+
+
+ image +

Construction Planning

+

We pride ourselves on delivering high-quality construction services tailored to meet the unique needs of our clients. With years of experience in the industry, our team of skilled professionals is dedicated to bringing your vision to life. Whether you are looking to build a new structure, renovate an existing space, or need specialized construction services, we are here to help.

+

With years of industry experience, our team handles every aspect of the construction process, your project runs smoothly and efficiently. We prioritize open communication, timely delivery, and quality workmanship to exceed your expectations. Trust us to provide innovative solutions that.

+

Building with Unmatched Excellence

+

Transform your existing space with our renovation and remodeling services. Whether you want to update your kitchen, bathroom, or entire home, we bring innovative solutions to enhance your living space. Our team has extensive experience in commercial construction, including office buildings, retail spaces, and industrial facilities. We work closely with you to ensure your project align.

+
+
+ image +
+
+ image +
+
+

We deliver exceptional construction services backed by years of experience. Our skilled team prioritizes quality, transparency, and client satisfaction. We utilize innovative techniques and sustainable practices, ensuring timely project completion. Trust us to bring your to life with unmatched craftsmanship

+
    +
  • Our skilled professionals bring years of experience a
  • +
  • We are the leading construction company in the industry.
  • +
  • Our transparent pricing ensures no hidden fees or surprises.
  • +
  • We adhere to strict safety standards on all job sites.
  • +
+

Commonly Asked Questions

+
+
+
1. What services do you offer?
+
+

We offer a range of services including construction management, design-build solutions, renovations, and specialty contracting for both residential and commercial projects

+
+
+
+ +
+

Yes, we offer free estimates for all potential projects. We assess your requirements and provide a detailed quote without any obligation

+
+
+
+ +
+

Yes, we are fully licensed and insured to operate in our service areas. This ensures that your project is protected and complies with all local regulations

+
+
+
+
+
+
+
+
+ +@endsection \ No newline at end of file