<?php

namespace Database\Seeders\Tenant;

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

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

    private function data(): array
    {
        return [
            [
                'tab' => 'Site',
                'section' => 'SEO',
                'group' => 'Site Verification',
                'name' => 'Google Search Console Verification Code',
                'config_key' => 'seo-google-site-verification',
                'type' => 'string',
                'value' => '',
                'description' => 'The content value from the Google Search Console HTML tag '
                    . 'verification method (the value of the meta tag, not the whole tag). '
                    . '<a href="https://support.google.com/webmasters/answer/9008080?hl=en#html_verification" '
                    . 'target="_blank">How to verify</a>.',
                'validation_rules' => ['nullable', 'string', 'max:255', 'not_regex:/[<>]/'],
            ],
            [
                'tab' => 'Site',
                'section' => 'SEO',
                'group' => 'Site Verification',
                'name' => 'Bing Webmaster Tools Verification Code',
                'config_key' => 'seo-bing-site-verification',
                'type' => 'string',
                'value' => '',
                'description' => 'The content value from the Bing Webmaster Tools meta tag '
                    . 'verification method (the value of the <code>msvalidate.01</code> meta tag). '
                    . '<a href="https://www.bing.com/webmasters/help/add-and-verify-site-12184f8b" '
                    . 'target="_blank">How to verify</a>.',
                'validation_rules' => ['nullable', 'string', 'max:255', 'not_regex:/[<>]/'],
            ],
        ];
    }
}
