Add solutions image upload field and update settings: introduce a file upload component for solutions images in ManageSolutions, add solutions_image property to SolutionSettings, and update related database migrations and views to support dynamic image display.
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
namespace App\Filament\Pages;
|
namespace App\Filament\Pages;
|
||||||
|
|
||||||
use App\Settings\SolutionSettings;
|
use App\Settings\SolutionSettings;
|
||||||
|
use Filament\Forms\Components\FileUpload;
|
||||||
use Filament\Forms\Components\Grid;
|
use Filament\Forms\Components\Grid;
|
||||||
use Filament\Forms\Components\Repeater;
|
use Filament\Forms\Components\Repeater;
|
||||||
use Filament\Forms\Components\Section;
|
use Filament\Forms\Components\Section;
|
||||||
@@ -33,6 +34,11 @@ class ManageSolutions extends SettingsPage
|
|||||||
->label('Header')
|
->label('Header')
|
||||||
->required()
|
->required()
|
||||||
->maxLength(255),
|
->maxLength(255),
|
||||||
|
FileUpload::make('solutions_image')
|
||||||
|
->label('Image')
|
||||||
|
->image()
|
||||||
|
->directory('solutions')
|
||||||
|
->required(),
|
||||||
Grid::make()->schema([
|
Grid::make()->schema([
|
||||||
TextInput::make('solutions_button_text')
|
TextInput::make('solutions_button_text')
|
||||||
->label('Button Text')
|
->label('Button Text')
|
||||||
|
|||||||
@@ -14,6 +14,8 @@ class SolutionSettings extends Settings
|
|||||||
|
|
||||||
public string $solutions_button_url;
|
public string $solutions_button_url;
|
||||||
|
|
||||||
|
public ?string $solutions_image;
|
||||||
|
|
||||||
public array $solution_items;
|
public array $solution_items;
|
||||||
|
|
||||||
public static function group(): string
|
public static function group(): string
|
||||||
|
|||||||
24
database/factories/NewsFactory.php
Normal file
24
database/factories/NewsFactory.php
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Database\Factories;
|
||||||
|
|
||||||
|
use App\Models\News;
|
||||||
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||||
|
use Illuminate\Support\Str;
|
||||||
|
|
||||||
|
class NewsFactory extends Factory
|
||||||
|
{
|
||||||
|
protected $model = News::class;
|
||||||
|
|
||||||
|
public function definition()
|
||||||
|
{
|
||||||
|
$title = $this->faker->sentence(6);
|
||||||
|
return [
|
||||||
|
'title' => $title,
|
||||||
|
'slug' => Str::slug($title),
|
||||||
|
'content' => $this->faker->paragraphs(3, true),
|
||||||
|
'image' => 'news/' . $this->faker->image('public/storage/news', 640, 480, null, false),
|
||||||
|
'published_at' => $this->faker->dateTimeBetween('-1 year', 'now'),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -15,6 +15,7 @@ class DatabaseSeeder extends Seeder
|
|||||||
$this->call([
|
$this->call([
|
||||||
UsersTableSeeder::class,
|
UsersTableSeeder::class,
|
||||||
BrandTableSeeder::class,
|
BrandTableSeeder::class,
|
||||||
|
NewsTableSeeder::class,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
18
database/seeders/NewsTableSeeder.php
Normal file
18
database/seeders/NewsTableSeeder.php
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Database\Seeders;
|
||||||
|
|
||||||
|
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||||
|
use Illuminate\Database\Seeder;
|
||||||
|
use App\Models\News;
|
||||||
|
|
||||||
|
class NewsTableSeeder extends Seeder
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the database seeds.
|
||||||
|
*/
|
||||||
|
public function run(): void
|
||||||
|
{
|
||||||
|
News::factory()->count(20)->create();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -6,7 +6,7 @@ return new class extends SettingsMigration
|
|||||||
{
|
{
|
||||||
public function up(): void
|
public function up(): void
|
||||||
{
|
{
|
||||||
$this->migrator->add('cms_homepage.bg_video', 'http://127.0.0.1:8000/web/assets/video/banner.mp4');
|
$this->migrator->add('cms_homepage.bg_video', 'http://192.168.1.180:8000/web/assets/video/banner.mp4');
|
||||||
$this->migrator->add('cms_homepage.hero_badge_text', 'Expert Solutions');
|
$this->migrator->add('cms_homepage.hero_badge_text', 'Expert Solutions');
|
||||||
$this->migrator->add('cms_homepage.hero_header', 'Shaping Future');
|
$this->migrator->add('cms_homepage.hero_header', 'Shaping Future');
|
||||||
$this->migrator->add('cms_homepage.hero_sub_header', 'Architecture');
|
$this->migrator->add('cms_homepage.hero_sub_header', 'Architecture');
|
||||||
@@ -24,7 +24,7 @@ return new class extends SettingsMigration
|
|||||||
$this->migrator->add('cms_homepage.about_reviews_text', 'Client Reviews');
|
$this->migrator->add('cms_homepage.about_reviews_text', 'Client Reviews');
|
||||||
$this->migrator->add('cms_homepage.about_button_text', 'Our Story');
|
$this->migrator->add('cms_homepage.about_button_text', 'Our Story');
|
||||||
$this->migrator->add('cms_homepage.about_button_url', 'http://gujurly.com');
|
$this->migrator->add('cms_homepage.about_button_url', 'http://gujurly.com');
|
||||||
$this->migrator->add('cms_homepage.about_image_one', 'http://127.0.0.1:8000/web/assets/img/about/about-5.jpg');
|
$this->migrator->add('cms_homepage.about_image_one', 'http://192.168.1.180:8000/web/assets/img/about/about-5.jpg');
|
||||||
$this->migrator->add('cms_homepage.about_image_two', 'http://127.0.0.1:8000/web/assets/img/about/about-6.jpg');
|
$this->migrator->add('cms_homepage.about_image_two', 'http://192.168.1.180:8000/web/assets/img/about/about-6.jpg');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ return new class extends SettingsMigration
|
|||||||
$this->migrator->add('cms_solutions.solutions_subtitle', 'Our Services');
|
$this->migrator->add('cms_solutions.solutions_subtitle', 'Our Services');
|
||||||
$this->migrator->add('cms_solutions.solutions_header', 'Provide Quality Services');
|
$this->migrator->add('cms_solutions.solutions_header', 'Provide Quality Services');
|
||||||
$this->migrator->add('cms_solutions.solutions_button_text', 'more Services');
|
$this->migrator->add('cms_solutions.solutions_button_text', 'more Services');
|
||||||
|
$this->migrator->add('cms_solutions.solutions_image', 'http://192.168.1.180:8000/web/assets/img/page/services.jpg');
|
||||||
$this->migrator->add('cms_solutions.solutions_button_url', 'services.html');
|
$this->migrator->add('cms_solutions.solutions_button_url', 'services.html');
|
||||||
$this->migrator->add('cms_solutions.solution_items', [
|
$this->migrator->add('cms_solutions.solution_items', [
|
||||||
['icon_class' => 'flaticon-it-department', 'title' => 'Flooring Installation', 'link' => '#'],
|
['icon_class' => 'flaticon-it-department', 'title' => 'Flooring Installation', 'link' => '#'],
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ return new class extends SettingsMigration
|
|||||||
$this->migrator->add('cms_success.success_header', 'Building Success With Expert Advisory Services');
|
$this->migrator->add('cms_success.success_header', 'Building Success With Expert Advisory Services');
|
||||||
$this->migrator->add('cms_success.success_paragraph', 'With a focus on innovation and sustainability, we help you navigate complex challenges, ensuring');
|
$this->migrator->add('cms_success.success_paragraph', 'With a focus on innovation and sustainability, we help you navigate complex challenges, ensuring');
|
||||||
$this->migrator->add('cms_success.success_button_text', 'Get Advices');
|
$this->migrator->add('cms_success.success_button_text', 'Get Advices');
|
||||||
$this->migrator->add('cms_success.success_button_url', 'contact.html');
|
$this->migrator->add('cms_success.success_button_url', 'http://gujurly.com');
|
||||||
$this->migrator->add('cms_success.skill_items', [
|
$this->migrator->add('cms_success.skill_items', [
|
||||||
['name' => 'Building Construction', 'percentage' => 89],
|
['name' => 'Building Construction', 'percentage' => 89],
|
||||||
['name' => 'Interiors Design', 'percentage' => 70],
|
['name' => 'Interiors Design', 'percentage' => 70],
|
||||||
|
|||||||
@@ -139,7 +139,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-xl-7 col-lg-6">
|
<div class="col-xl-7 col-lg-6">
|
||||||
<div class="services__four-image wow img_top_animation">
|
<div class="services__four-image wow img_top_animation">
|
||||||
<img src="/web/assets/img/page/services.jpg" alt="image">
|
<img src="/storage/{{ $solutionSettings->solutions_image }}" alt="image">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
<div class="col-xl-4 col-lg-6 wow fadeInUp" data-wow-delay=".4s">
|
<div class="col-xl-4 col-lg-6 wow fadeInUp" data-wow-delay=".4s">
|
||||||
<div class="blog__one-item">
|
<div class="blog__one-item">
|
||||||
<div class="blog__one-item-image">
|
<div class="blog__one-item-image">
|
||||||
<a href="{{ route('news.show', $news->slug) }}"><img src="assets/img/blog/blog-1.jpg" alt="image"></a>
|
<a href="{{ route('news.show', $news->slug) }}"><img src="/storage/{{ $news->image }}" alt="image"></a>
|
||||||
<div class="blog__one-item-image-date">
|
<div class="blog__one-item-image-date">
|
||||||
<h6><i class="fa-regular fa-calendar"></i>{{ \Carbon\Carbon::parse($news->published_at)->format('d M') }}</h6>
|
<h6><i class="fa-regular fa-calendar"></i>{{ \Carbon\Carbon::parse($news->published_at)->format('d M') }}</h6>
|
||||||
</div>
|
</div>
|
||||||
@@ -38,76 +38,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@endforeach
|
@endforeach
|
||||||
<div class="col-xl-4 col-lg-6 wow fadeInUp" data-wow-delay=".7s">
|
|
||||||
<div class="blog__one-item">
|
|
||||||
<div class="blog__one-item-image">
|
|
||||||
<a href="blog-details.html"><img src="assets/img/blog/blog-2.jpg" alt="image"></a>
|
|
||||||
<div class="blog__one-item-image-date">
|
|
||||||
<h6><i class="fa-regular fa-calendar"></i>19 Dec</h6>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="blog__one-item-content">
|
|
||||||
<h4><a href="blog-details.html">How to Choose the Perfect Construction Company</a></h4>
|
|
||||||
<a class="more_btn" href="blog-details.html">Read More<i class="flaticon-right-up"></i></a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-xl-4 col-lg-6 wow fadeInUp" data-wow-delay="1s">
|
|
||||||
<div class="blog__one-item">
|
|
||||||
<div class="blog__one-item-image">
|
|
||||||
<a href="blog-details.html"><img src="assets/img/blog/blog-3.jpg" alt="image"></a>
|
|
||||||
<div class="blog__one-item-image-date">
|
|
||||||
<h6><i class="fa-regular fa-calendar"></i>14 Dec</h6>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="blog__one-item-content">
|
|
||||||
<h4><a href="blog-details.html">Top Mistakes to Avoid During Home Renovation</a></h4>
|
|
||||||
<a class="more_btn" href="blog-details.html">Read More<i class="flaticon-right-up"></i></a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-xl-4 col-lg-6 wow fadeInUp" data-wow-delay=".4s">
|
|
||||||
<div class="blog__one-item">
|
|
||||||
<div class="blog__one-item-image">
|
|
||||||
<a href="blog-details.html"><img src="assets/img/blog/blog-6.jpg" alt="image"></a>
|
|
||||||
<div class="blog__one-item-image-date">
|
|
||||||
<h6><i class="fa-regular fa-calendar"></i>22 Dec</h6>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="blog__one-item-content">
|
|
||||||
<h4><a href="blog-details.html">Key Steps to Ensure a Smooth Building Process</a></h4>
|
|
||||||
<a class="more_btn" href="blog-details.html">Read More<i class="flaticon-right-up"></i></a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-xl-4 col-lg-6 wow fadeInUp" data-wow-delay=".7s">
|
|
||||||
<div class="blog__one-item">
|
|
||||||
<div class="blog__one-item-image">
|
|
||||||
<a href="blog-details.html"><img src="assets/img/blog/blog-5.jpg" alt="image"></a>
|
|
||||||
<div class="blog__one-item-image-date">
|
|
||||||
<h6><i class="fa-regular fa-calendar"></i>24 Dec</h6>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="blog__one-item-content">
|
|
||||||
<h4><a href="blog-details.html">How to Maximize Space in Your Commercial Building</a></h4>
|
|
||||||
<a class="more_btn" href="blog-details.html">Read More<i class="flaticon-right-up"></i></a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-xl-4 col-lg-6 wow fadeInUp" data-wow-delay="1s">
|
|
||||||
<div class="blog__one-item">
|
|
||||||
<div class="blog__one-item-image">
|
|
||||||
<a href="blog-details.html"><img src="assets/img/blog/blog-4.jpg" alt="image"></a>
|
|
||||||
<div class="blog__one-item-image-date">
|
|
||||||
<h6><i class="fa-regular fa-calendar"></i>25 Dec</h6>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="blog__one-item-content">
|
|
||||||
<h4><a href="blog-details.html">The Future of Smart Homes in Construction</a></h4>
|
|
||||||
<a class="more_btn" href="blog-details.html">Read More<i class="flaticon-right-up"></i></a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="row mt-25">
|
<div class="row mt-25">
|
||||||
<div class="col-xl-12">
|
<div class="col-xl-12">
|
||||||
|
|||||||
Reference in New Issue
Block a user