refactor: update product feature icon to text input and remove required validation from core product fields

This commit is contained in:
Ümit Tunç
2026-05-26 23:49:22 +03:00
parent c68e95631b
commit 5848cd5189
2 changed files with 4 additions and 10 deletions
@@ -104,10 +104,8 @@ class LandingPageSection
Repeater::make('landing_page_data.features') Repeater::make('landing_page_data.features')
->label(__('products.features')) ->label(__('products.features'))
->schema([ ->schema([
Select::make('icon') TextInput::make('icon')
->label(__('products.feature_icon')) ->label(__('products.feature_icon')),
->options($iconOptions)
->searchable(),
TextInput::make('title') TextInput::make('title')
->label(__('products.feature_title')) ->label(__('products.feature_title'))
->columnSpanFull(), ->columnSpanFull(),
@@ -25,7 +25,6 @@ class ProductForm
->schema([ ->schema([
TextInput::make('title') TextInput::make('title')
->label(__('products.title')) ->label(__('products.title'))
->required()
->live(onBlur: true) ->live(onBlur: true)
->afterStateUpdated(function (Get $get, Set $set, ?string $state) { ->afterStateUpdated(function (Get $get, Set $set, ?string $state) {
$set('slug', Str::slug($state)); $set('slug', Str::slug($state));
@@ -35,15 +34,13 @@ class ProductForm
->dehydrated(false), ->dehydrated(false),
TextInput::make('slug') TextInput::make('slug')
->label(__('products.slug')) ->label(__('products.slug'))
->required()
->unique(ignoreRecord: true), ->unique(ignoreRecord: true),
Select::make('type') Select::make('type')
->label(__('products.type')) ->label(__('products.type'))
->options([ ->options([
'product' => __('products.product'), 'product' => __('products.product'),
'service' => __('products.service'), 'service' => __('products.service'),
]) ]),
->required(),
Select::make('product_category_id') Select::make('product_category_id')
->label(__('products.category')) ->label(__('products.category'))
->options(function () { ->options(function () {
@@ -54,7 +51,6 @@ class ProductForm
->searchable(), ->searchable(),
FileUpload::make('hero_image') FileUpload::make('hero_image')
->label(__('products.hero_image')) ->label(__('products.hero_image'))
->required()
->image() ->image()
->disk('public') ->disk('public')
->directory('products'), ->directory('products'),
@@ -81,7 +77,7 @@ class ProductForm
'title' => [ 'title' => [
'type' => 'text', 'type' => 'text',
'label' => __('products.title'), 'label' => __('products.title'),
'required' => true, 'required' => false,
], ],
'content' => [ 'content' => [
'type' => 'richtext', 'type' => 'richtext',