<?php

namespace Database\Seeders\Tenant;

use App\Facades\Settings;
use Illuminate\Database\Seeder;

class FilterSortOptionsByPopularitySettingSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run(): void
    {
        collect($this->data())
            ->each(fn ($setting) => Settings::make($setting));
    }

    private function data(): array
    {
        return [
            [
                'tab' => 'Automotive',
                'section' => 'Filter',
                'group' => 'General',
                'name' => 'Sort filter options by popularity',
                'config_key' => 'filter-sort-options-by-popularity',
                'type' => 'boolean',
                'value' => false,
                'feature' => 'meilisearch-vehicle-filter',
                'description' => 'Sort filter options by result count (popularity) instead of alphabetically by name.',
            ]
        ];
    }
}
