<?php

namespace Database\Seeders\Tenant;

use Illuminate\Database\Seeder;
use Mtc\MercuryDataModels\Setting;

class ChangeCountrySettingValidationRules extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        Setting::query()
            ->where('config_key', 'app-details-country')
            ->update([
                'validation_rules' => [
                    'required',
                    'exists:' . config('tenancy.database.central_connection') . '.countries,code'
                ]
            ]);
    }
}
