<?php

namespace Database\Seeders;

use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;

class ConfigurationsSeeder extends Seeder
{

    private $table = 'configurations';
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        DB::table($this->table)->delete();


        DB::table($this->table)->insert(
            [
                [
                    'key'               => 'mailerlite.key',
                    'value'             => config('mailerlite.key') ? config('mailerlite.key') : 'Fill me!',
                    'name'              => 'Mailer Lite API Key',
                    'description'       => '',
                    'validation_rules'  => 'required',
                    'type'              => null,

                ],
                [
                    'key'               => 'api.enable_rpac_locations_list',
                    'value'             => false,
                    'name'              => 'RPAC internal locations list',
                    'description'       => 'If disabled the app will use the external link added in Configurations -> External RPAC link.',
                    'validation_rules'  => 'required|boolean',
                    'type'              => 'boolean',
                ],
                [
                    'key'               => 'api.external_rpac_link',
                    'value'             => null,
                    'name'              => 'External RPAC link',
                    'description'       => 'External link for the RPAC page that will appear, if filled out, in the App menu when the locations list screen is active',
                    'validation_rules'  => 'sometimes|url',
                    'type'              => null,
                ],
                [
                    'key'               => 'api.default_share_link',
                    'value'             => null,
                    'name'              => 'Default share link',
                    'description'       => 'This link will be used for exhibitions, collections and artists default share link if none is provided.',
                    'validation_rules'  => 'sometimes|url',
                    'type'              => null,
                ],
                [
                    'key'               => 'api.news_list_share_link',
                    'value'             =>  "",
                    'name'              => 'Site news list link',
                    'description'       => 'The news list url in the Contemporanea site to be used in share.',
                    'validation_rules'  => 'sometimes|url',
                    'type'              => null,
                ],
            ]
        );
    }
}
