feat(tenant): add display options for categories and search bar; update requests, migrations, seeder, and tests

This commit is contained in:
2026-08-11 10:04:18 -03:00
parent 8d8e49fcfb
commit 68dd373d61
8 changed files with 69 additions and 0 deletions

View File

@@ -33,6 +33,8 @@ use Illuminate\Database\Eloquent\Relations\HasMany;
'search_product_layout',
'search_group_layout',
'search_items_per_page',
'display_categories',
'display_seach_bar',
'event_title',
'event_location',
'event_date_text',
@@ -45,6 +47,8 @@ class Tenant extends Model
'search_product_layout' => ProductLayout::ColumnWithImage->value,
'search_group_layout' => GroupLayout::Paginated->value,
'search_items_per_page' => 12,
'display_categories' => true,
'display_seach_bar' => true,
];
public function getRouteKeyName(): string
@@ -63,6 +67,8 @@ class Tenant extends Model
'search_product_layout' => ProductLayout::class,
'search_group_layout' => GroupLayout::class,
'search_items_per_page' => 'integer',
'display_categories' => 'boolean',
'display_seach_bar' => 'boolean',
];
}

View File

@@ -75,6 +75,8 @@ class StoreTenantRequest extends FormRequest
'search_product_layout' => ['sometimes', Rule::enum(ProductLayout::class)],
'search_group_layout' => ['sometimes', Rule::enum(GroupLayout::class)],
'search_items_per_page' => ['sometimes', 'integer', 'min:4', 'max:48'],
'display_categories' => ['sometimes', 'boolean'],
'display_seach_bar' => ['sometimes', 'boolean'],
'website_type_code' => [
'required_with:extras',
'sometimes',

View File

@@ -85,6 +85,8 @@ class UpdateTenantRequest extends FormRequest
'search_product_layout' => ['sometimes', Rule::enum(ProductLayout::class)],
'search_group_layout' => ['sometimes', Rule::enum(GroupLayout::class)],
'search_items_per_page' => ['sometimes', 'integer', 'min:4', 'max:48'],
'display_categories' => ['sometimes', 'boolean'],
'display_seach_bar' => ['sometimes', 'boolean'],
];
}
}

View File

@@ -61,6 +61,8 @@ class TenantResource extends JsonResource
'search_product_layout' => $this->search_product_layout->value,
'search_group_layout' => $this->search_group_layout->value,
'search_items_per_page' => $this->search_items_per_page,
'display_categories' => $this->display_categories,
'display_seach_bar' => $this->display_seach_bar,
'social_media' => $this->whenLoaded(
'socialMedia',
fn () => $this->socialMedia