Enhance ManageSolutions and ManageSuccess forms: replace icon_class text input with a searchable select component in ManageSolutions, add file upload for success images in ManageSuccess, and update SuccessSettings to include success_image property. Adjust related database migrations and views for dynamic content display.

This commit is contained in:
2025-07-28 18:28:29 +05:00
parent d316f392bc
commit 189cb53856
7 changed files with 282 additions and 9 deletions

View File

@@ -7,6 +7,7 @@ use Filament\Forms\Components\FileUpload;
use Filament\Forms\Components\Grid;
use Filament\Forms\Components\Repeater;
use Filament\Forms\Components\Section;
use Filament\Forms\Components\Select;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Form;
use Filament\Pages\SettingsPage;
@@ -58,11 +59,12 @@ class ManageSolutions extends SettingsPage
Repeater::make('solution_items')
->label('Solution Items')
->schema([
TextInput::make('icon_class')
Select::make('icon_class')
->label('Icon Class')
->searchable()
->helperText('e.g., flaticon-it-department. Refer to Flaticon for available icons.')
->required()
->maxLength(100),
->options(self::getIconOptions()),
TextInput::make('title')
->label('Title')
->required()
@@ -86,6 +88,268 @@ class ManageSolutions extends SettingsPage
->statePath('data');
}
private static function getIconOptions(): array
{
return [
"microsoft-word" => "microsoft-word",
"text-box" => "text-box",
"document-1" => "document-1",
"layers-1" => "layers-1",
"folder-1" => "folder-1",
"contract" => "contract",
"layer" => "layer",
"download-pdf" => "download-pdf",
"pdf" => "pdf",
"cloud-computing" => "cloud-computing",
"downloads" => "downloads",
"layers" => "layers",
"document" => "document",
"light-bulb-1" => "light-bulb-1",
"idea-2" => "idea-2",
"light-bulb" => "light-bulb",
"idea-1" => "idea-1",
"solution-2" => "solution-2",
"lightbulb" => "lightbulb",
"menus" => "menus",
"support-1" => "support-1",
"swipe-left" => "swipe-left",
"development" => "development",
"domain" => "domain",
"pets" => "pets",
"diagram" => "diagram",
"targeting" => "targeting",
"business-intelligence" => "business-intelligence",
"menu-6" => "menu-6",
"high-quality" => "high-quality",
"campaign" => "campaign",
"brain" => "brain",
"software-application" => "software-application",
"apps" => "apps",
"wrench-1" => "wrench-1",
"social-media-marketing-1" => "social-media-marketing-1",
"category-1" => "category-1",
"trophy-3" => "trophy-3",
"email-marketing" => "email-marketing",
"setting" => "setting",
"more" => "more",
"menu-5" => "menu-5",
"menu-4" => "menu-4",
"medical" => "medical",
"sparkle" => "sparkle",
"menu-3" => "menu-3",
"technology-2" => "technology-2",
"process" => "process",
"hearth-1" => "hearth-1",
"hearth" => "hearth",
"technology-1" => "technology-1",
"category" => "category",
"customer-care" => "customer-care",
"folder" => "folder",
"portfolio-1" => "portfolio-1",
"report" => "report",
"thinking" => "thinking",
"fingerprint" => "fingerprint",
"clock-2" => "clock-2",
"award" => "award",
"paper-plane" => "paper-plane",
"repair" => "repair",
"email-5" => "email-5",
"strategy" => "strategy",
"portfolio" => "portfolio",
"web-design" => "web-design",
"email-4" => "email-4",
"down-arrow-1" => "down-arrow-1",
"location-2" => "location-2",
"phone-call-2" => "phone-call-2",
"telephone-call" => "telephone-call",
"teamwork" => "teamwork",
"up-arrow-1" => "up-arrow-1",
"menu-2" => "menu-2",
"developing" => "developing",
"money-bag" => "money-bag",
"thumbs-up" => "thumbs-up",
"profits" => "profits",
"location-1" => "location-1",
"help-1" => "help-1",
"online-chat" => "online-chat",
"worker" => "worker",
"smart-home" => "smart-home",
"customer-service-1" => "customer-service-1",
"internet" => "internet",
"cash-flow" => "cash-flow",
"monitor" => "monitor",
"search-1" => "search-1",
"wrench" => "wrench",
"coin" => "coin",
"cash" => "cash",
"analyst" => "analyst",
"dashboard-1" => "dashboard-1",
"digital" => "digital",
"searching" => "searching",
"email-3" => "email-3",
"star-1" => "star-1",
"touch" => "touch",
"medal" => "medal",
"world-wide-web-1" => "world-wide-web-1",
"phone" => "phone",
"social-media" => "social-media",
"24-7" => "24-7",
"hard-work" => "hard-work",
"star" => "star",
"plus" => "plus",
"minus-2" => "minus-2",
"menu-1" => "menu-1",
"cloud" => "cloud",
"handshake" => "handshake",
"people" => "people",
"ai" => "ai",
"save-money" => "save-money",
"shopping-online" => "shopping-online",
"profit-1" => "profit-1",
"blockchain" => "blockchain",
"sales" => "sales",
"back-in-time" => "back-in-time",
"clock-1" => "clock-1",
"user-3" => "user-3",
"user-2" => "user-2",
"pawprint" => "pawprint",
"payment-method" => "payment-method",
"world-wide-web" => "world-wide-web",
"minus-1" => "minus-1",
"add-1" => "add-1",
"management" => "management",
"help" => "help",
"chip" => "chip",
"artificial-intelligence" => "artificial-intelligence",
"group" => "group",
"money-1" => "money-1",
"conversation" => "conversation",
"email-2" => "email-2",
"rating" => "rating",
"placeholder" => "placeholder",
"trophy-2" => "trophy-2",
"cpu" => "cpu",
"home" => "home",
"right-arrow-1" => "right-arrow-1",
"like" => "like",
"mail" => "mail",
"briefcase" => "briefcase",
"money" => "money",
"up-arrow" => "up-arrow",
"trophy-1" => "trophy-1",
"user-1" => "user-1",
"question" => "question",
"team-1" => "team-1",
"user" => "user",
"email-1" => "email-1",
"price-tag-1" => "price-tag-1",
"tag" => "tag",
"loupe" => "loupe",
"right-arrow" => "right-arrow",
"left-arrow-1" => "left-arrow-1",
"down-arrow" => "down-arrow",
"price-tag" => "price-tag",
"stars" => "stars",
"search" => "search",
"phone-call-1" => "phone-call-1",
"award-symbol" => "award-symbol",
"christmas-stars" => "christmas-stars",
"minus" => "minus",
"add" => "add",
"cancel-1" => "cancel-1",
"checked" => "checked",
"cyber-security" => "cyber-security",
"data-protection" => "data-protection",
"hosting" => "hosting",
"brand-awareness" => "brand-awareness",
"ux-design" => "ux-design",
"influencer" => "influencer",
"online-advertising" => "online-advertising",
"web-management" => "web-management",
"seo-1" => "seo-1",
"computer" => "computer",
"software-development" => "software-development",
"coding-1" => "coding-1",
"coding" => "coding",
"app-development" => "app-development",
"content-marketing" => "content-marketing",
"social-media-marketing" => "social-media-marketing",
"analysis-1" => "analysis-1",
"twitter" => "twitter",
"repairing" => "repairing",
"data-visualization" => "data-visualization",
"information-technology" => "information-technology",
"statistics-1" => "statistics-1",
"exploration" => "exploration",
"project-1" => "project-1",
"cross-mark" => "cross-mark",
"search-analysis" => "search-analysis",
"system" => "system",
"hashtag-1" => "hashtag-1",
"hashtag" => "hashtag",
"it-department" => "it-department",
"creative" => "creative",
"online-analytical" => "online-analytical",
"secure-data" => "secure-data",
"slash" => "slash",
"creative-thinking" => "creative-thinking",
"right-up" => "right-up",
"dashboard" => "dashboard",
"profit" => "profit",
"project" => "project",
"phone-call" => "phone-call",
"seo" => "seo",
"prototype" => "prototype",
"creative-process" => "creative-process",
"growth" => "growth",
"technical-support" => "technical-support",
"technology" => "technology",
"solution-1" => "solution-1",
"creative-tools" => "creative-tools",
"data-science" => "data-science",
"costumer" => "costumer",
"cooperation" => "cooperation",
"next" => "next",
"back" => "back",
"brand" => "brand",
"right-arrows" => "right-arrows",
"idea" => "idea",
"design-thinking" => "design-thinking",
"check" => "check",
"cross" => "cross",
"right" => "right",
"link" => "link",
"server" => "server",
"analysis" => "analysis",
"support" => "support",
"project-management" => "project-management",
"networking" => "networking",
"team" => "team",
"check-mark" => "check-mark",
"consultation" => "consultation",
"solution" => "solution",
"success" => "success",
"customer-review" => "customer-review",
"select" => "select",
"statistics" => "statistics",
"machine-learning" => "machine-learning",
"vector" => "vector",
"trophy" => "trophy",
"data" => "data",
"clock" => "clock",
"cancel" => "cancel",
"customer-service" => "customer-service",
"digital-marketing" => "digital-marketing",
"email" => "email",
"stats" => "stats",
"menu" => "menu",
"location" => "location",
"tick" => "tick",
"left-arrow" => "left-arrow",
"dots-menu" => "dots-menu",
];
}
public static function getNavigationGroup(): ?string
{
return __('CMS');

View File

@@ -8,6 +8,7 @@ use Filament\Forms\Components\Repeater;
use Filament\Forms\Components\Section;
use Filament\Forms\Components\Textarea;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Components\FileUpload;
use Filament\Forms\Form;
use Filament\Pages\SettingsPage;
use Illuminate\Contracts\Support\Htmlable;
@@ -50,6 +51,11 @@ class ManageSuccess extends SettingsPage
->maxLength(255)
->url(),
])->columns(2),
FileUpload::make('success_image')
->label('Image')
->directory('cms')
->image()
->required(),
]),
Section::make('Skill Items')
->description('Manage the skill items with their names and percentages.')

View File

@@ -18,6 +18,8 @@ class SuccessSettings extends Settings
public array $skill_items;
public string $success_image;
public static function group(): string
{
return 'cms_success';

View File

@@ -13,6 +13,6 @@ class NewsTableSeeder extends Seeder
*/
public function run(): void
{
News::factory()->count(20)->create();
News::factory()->count(12)->create();
}
}

View File

@@ -10,12 +10,12 @@ return new class extends SettingsMigration
$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_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', 'http://gujurly.com');
$this->migrator->add('cms_solutions.solution_items', [
['icon_class' => 'flaticon-it-department', 'title' => 'Flooring Installation', 'link' => '#'],
['icon_class' => 'flaticon-project', 'title' => 'Building Architecture', 'link' => '#'],
['icon_class' => 'flaticon-design-thinking', 'title' => 'Interior Design', 'link' => '#'],
['icon_class' => 'flaticon-data', 'title' => 'House Renovation', 'link' => '#'],
['icon_class' => 'flaticon-it-department', 'title' => 'Flooring Installation', 'link' => 'http://gujurly.com'],
['icon_class' => 'flaticon-project', 'title' => 'Building Architecture', 'link' => 'http://gujurly.com'],
['icon_class' => 'flaticon-design-thinking', 'title' => 'Interior Design', 'link' => 'http://gujurly.com'],
['icon_class' => 'flaticon-data', 'title' => 'House Renovation', 'link' => 'http://gujurly.com'],
]);
}
};

View File

@@ -15,5 +15,6 @@ return new class extends SettingsMigration
['name' => 'Building Construction', 'percentage' => 89],
['name' => 'Interiors Design', 'percentage' => 70],
]);
$this->migrator->add('cms_success.success_image', 'cms/skill.jpg');
}
};

View File

@@ -179,7 +179,7 @@
</div>
<div class="col-lg-6">
<div class="success__area-right">
<img class="lg_img_full wow img_top_animation" src="/web/assets/img/page/skill.jpg" alt="image">
<img class="lg_img_full wow img_top_animation" src="/storage/{{ $successSettings->success_image }}" alt="image">
<div class="success__area-right-skill mt-40 wow fadeInUp" data-wow-delay=".5s">
@foreach($successSettings->skill_items as $skill)
<div class="skill__area-item">