<?php

namespace Database\Seeders;

use App\Models\GenericBackoffice\SimpleLink;
use Illuminate\Database\Seeder;
use Carbon\Carbon;
use Illuminate\Support\Facades\DB;

class SimpleLinksTableSeeder extends Seeder
{
    private $table = 'simple_links';
    private $langTable = 'simple_link_languages';

    private $websiteTable = 'website_objects';
    private $websiteLangTable = 'website_objects_lang';

    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        // Table already deleted in DatabaseSeeder

        $now = Carbon::now();

        DB::table($this->table)->insert(
            [
                [
                    'id'                => 1,
                    'backend_user_id'   => 1,
                    'link_info'         => '{"url":null,"label":"Discovery & Exploration","objectId":"109","isExternal":false}',
                    'link_effect'       => 'top_right_arrow_icon',
                    'link_icon_size'    => 'xmedium_icon',
                    'link_icon_side'    => 'right',
                    'link_text_size'    => 'mediumTextLink',
                    'created_at'        => $now
                ],
                [
                    'id'                => 2,
                    'backend_user_id'   => 1,
                    'link_info'         => '{"url":null,"label":"Digital Solutions Strategy","objectId":"110","isExternal":false}',
                    'link_effect'       => 'top_right_arrow_icon',
                    'link_icon_size'    => 'xmedium_icon',
                    'link_icon_side'    => 'right',
                    'link_text_size'    => 'mediumTextLink',
                    'created_at'        => $now
                ],
                [
                    'id'                => 3,
                    'backend_user_id'   => 1,
                    'link_info'         => '{"url":null,"label":"Prototyping & Design","objectId":"111","isExternal":false}',
                    'link_effect'       => 'top_right_arrow_icon',
                    'link_icon_size'    => 'xmedium_icon',
                    'link_icon_side'    => 'right',
                    'link_text_size'    => 'mediumTextLink',
                    'created_at'        => $now
                ],
                [
                    'id'                => 4,
                    'backend_user_id'   => 1,
                    'link_info'         => '{"url":null,"label":"Digital Development","objectId":"112","isExternal":false}',
                    'link_effect'       => 'top_right_arrow_icon',
                    'link_icon_size'    => 'xmedium_icon',
                    'link_icon_side'    => 'right',
                    'link_text_size'    => 'mediumTextLink',
                    'created_at'        => $now
                ],
                [
                    'id'                => 5,
                    'backend_user_id'   => 1,
                    'link_info'         => '{"url":null,"label":"Digital Branding","objectId":"113","isExternal":false}',
                    'link_effect'       => 'top_right_arrow_icon',
                    'link_icon_size'    => 'xmedium_icon',
                    'link_icon_side'    => 'right',
                    'link_text_size'    => 'mediumTextLink',
                    'created_at'        => $now
                ],
                [
                    'id'                => 6,
                    'backend_user_id'   => 1,
                    'link_info'         => '{"url":null,"label":"Digital Marketing","objectId":"114","isExternal":false}',
                    'link_effect'       => 'top_right_arrow_icon',
                    'link_icon_size'    => 'xmedium_icon',
                    'link_icon_side'    => 'right',
                    'link_text_size'    => 'mediumTextLink',
                    'created_at'        => $now
                ],

                [
                    'id'                => 7,
                    'backend_user_id'   => 1,
                    'link_info'         => '{"url":null,"label":"Read post","objectId":"106","isExternal":false}',
                    'link_effect'       => 'top_right_arrow_icon',
                    'link_icon_size'    => 'xmedium_icon',
                    'link_icon_side'    => 'right',
                    'link_text_size'    => 'mediumTextLink',
                    'created_at'        => $now
                ],
                [
                    'id'                => 8,
                    'backend_user_id'   => 1,
                    'link_info'         => '{"url":null,"label":"Read post","objectId":"106","isExternal":false}',
                    'link_effect'       => 'top_right_arrow_icon',
                    'link_icon_size'    => 'xmedium_icon',
                    'link_icon_side'    => 'right',
                    'link_text_size'    => 'mediumTextLink',
                    'created_at'        => $now
                ],

                [
                    'id'                => 9,
                    'backend_user_id'   => 1,
                    'link_info'         => '{"url":null,"label":"Discovery","objectId":"109","isExternal":false}',
                    'link_effect'       => 'top_right_arrow_icon',
                    'link_icon_size'    => 'xmedium_icon',
                    'link_icon_side'    => 'right',
                    'link_text_size'    => 'mediumTextLink',
                    'created_at'        => $now
                ],
                [
                    'id'                => 10,
                    'backend_user_id'   => 1,
                    'link_info'         => '{"url":null,"label":"Strategy","objectId":"110","isExternal":false}',
                    'link_effect'       => 'top_right_arrow_icon',
                    'link_icon_size'    => 'xmedium_icon',
                    'link_icon_side'    => 'right',
                    'link_text_size'    => 'mediumTextLink',
                    'created_at'        => $now
                ],
                [
                    'id'                => 11,
                    'backend_user_id'   => 1,
                    'link_info'         => '{"url":null,"label":"Design","objectId":"111","isExternal":false}',
                    'link_effect'       => 'top_right_arrow_icon',
                    'link_icon_size'    => 'xmedium_icon',
                    'link_icon_side'    => 'right',
                    'link_text_size'    => 'mediumTextLink',
                    'created_at'        => $now
                ],
                [
                    'id'                => 12,
                    'backend_user_id'   => 1,
                    'link_info'         => '{"url":null,"label":"Development","objectId":"112","isExternal":false}',
                    'link_effect'       => 'top_right_arrow_icon',
                    'link_icon_size'    => 'xmedium_icon',
                    'link_icon_side'    => 'right',
                    'link_text_size'    => 'mediumTextLink',
                    'created_at'        => $now
                ],
                [
                    'id'                => 13,
                    'backend_user_id'   => 1,
                    'link_info'         => '{"url":null,"label":"Branding","objectId":"113","isExternal":false}',
                    'link_effect'       => 'top_right_arrow_icon',
                    'link_icon_size'    => 'xmedium_icon',
                    'link_icon_side'    => 'right',
                    'link_text_size'    => 'mediumTextLink',
                    'created_at'        => $now
                ],
                [
                    'id'                => 14,
                    'backend_user_id'   => 1,
                    'link_info'         => '{"url":null,"label":"Marketing","objectId":"114","isExternal":false}',
                    'link_effect'       => 'top_right_arrow_icon',
                    'link_icon_size'    => 'xmedium_icon',
                    'link_icon_side'    => 'right',
                    'link_text_size'    => 'mediumTextLink',
                    'created_at'        => $now
                ],

            ]
        );

        DB::table($this->langTable)->insert(
            [
                [
                    'translation_id'    => 1,
                    'simple_link_id'    => 1,
                    'language_id'       => 'en',
                    'title'             => 'Discovery & Exploration',
                    'created_at'        => $now
                ],
                [
                    'translation_id'    => 2,
                    'simple_link_id'    => 2,
                    'language_id'       => 'en',
                    'title'             => 'Digital Solutions Strategy',
                    'created_at'        => $now
                ],
                [
                    'translation_id'    => 3,
                    'simple_link_id'    => 3,
                    'language_id'       => 'en',
                    'title'             => 'Prototyping & Design',
                    'created_at'        => $now
                ],
                [
                    'translation_id'    => 4,
                    'simple_link_id'    => 4,
                    'language_id'       => 'en',
                    'title'             => 'Digital Development',
                    'created_at'        => $now
                ],
                [
                    'translation_id'    => 5,
                    'simple_link_id'    => 5,
                    'language_id'       => 'en',
                    'title'             => 'Digital Branding',
                    'created_at'        => $now
                ],
                [
                    'translation_id'    => 6,
                    'simple_link_id'    => 6,
                    'language_id'       => 'en',
                    'title'             => 'Digital Marketing',
                    'created_at'        => $now
                ],

                [
                    'translation_id'    => 7,
                    'simple_link_id'    => 7,
                    'language_id'       => 'en',
                    'title'             => 'Blog Article left',
                    'created_at'        => $now
                ],
                [
                    'translation_id'    => 8,
                    'simple_link_id'    => 8,
                    'language_id'       => 'en',
                    'title'             => 'Blog Article right',
                    'created_at'        => $now
                ],

                [
                    'translation_id'    => 9,
                    'simple_link_id'    => 9,
                    'language_id'       => 'en',
                    'title'             => 'Discovery',
                    'created_at'        => $now
                ],
                [
                    'translation_id'    => 10,
                    'simple_link_id'    => 10,
                    'language_id'       => 'en',
                    'title'             => 'Strategy',
                    'created_at'        => $now
                ],
                [
                    'translation_id'    => 11,
                    'simple_link_id'    => 11,
                    'language_id'       => 'en',
                    'title'             => 'Design',
                    'created_at'        => $now
                ],
                [
                    'translation_id'    => 12,
                    'simple_link_id'    => 12,
                    'language_id'       => 'en',
                    'title'             => 'Development',
                    'created_at'        => $now
                ],
                [
                    'translation_id'    => 13,
                    'simple_link_id'    => 13,
                    'language_id'       => 'en',
                    'title'             => 'Branding',
                    'created_at'        => $now
                ],
                [
                    'translation_id'    => 14,
                    'simple_link_id'    => 14,
                    'language_id'       => 'en',
                    'title'             => 'Marketing',
                    'created_at'        => $now
                ],
            ]
        );

        DB::table($this->websiteTable)->insert(
            [
                [
                    'website_object_id' => 201,
                    'parent_id'         => null,
                    'object_id'         => 1,
                    'object_type'       => SimpleLink::class,
                    'content_type'      => 'simpleLink',
                    'slug'              => 'lnk-discovery-exploration',
                    'uri'               => null,
                    'template'          => null,
                    'status'            => 'published',
                    'position'          => 1,
                    'created_at'        => $now
                ],
                [
                    'website_object_id' => 202,
                    'parent_id'         => null,
                    'object_id'         => 2,
                    'object_type'       => SimpleLink::class,
                    'content_type'      => 'simpleLink',
                    'slug'              => 'lnk-digital-solutions-strategy',
                    'uri'               => null,
                    'template'          => null,
                    'status'            => 'published',
                    'position'          => 2,
                    'created_at'        => $now
                ],
                [
                    'website_object_id' => 203,
                    'parent_id'         => null,
                    'object_id'         => 3,
                    'object_type'       => SimpleLink::class,
                    'content_type'      => 'simpleLink',
                    'slug'              => 'lnk-prototyping-design',
                    'uri'               => null,
                    'template'          => null,
                    'status'            => 'published',
                    'position'          => 3,
                    'created_at'        => $now
                ],
                [
                    'website_object_id' => 204,
                    'parent_id'         => null,
                    'object_id'         => 4,
                    'object_type'       => SimpleLink::class,
                    'content_type'      => 'simpleLink',
                    'slug'              => 'lnk-digital-development',
                    'uri'               => null,
                    'template'          => null,
                    'status'            => 'published',
                    'position'          => 4,
                    'created_at'        => $now
                ],
                [
                    'website_object_id' => 205,
                    'parent_id'         => null,
                    'object_id'         => 5,
                    'object_type'       => SimpleLink::class,
                    'content_type'      => 'simpleLink',
                    'slug'              => 'lnk-digital-branding',
                    'uri'               => null,
                    'template'          => null,
                    'status'            => 'published',
                    'position'          => 5,
                    'created_at'        => $now
                ],
                [
                    'website_object_id' => 206,
                    'parent_id'         => null,
                    'object_id'         => 6,
                    'object_type'       => SimpleLink::class,
                    'content_type'      => 'simpleLink',
                    'slug'              => 'lnk-digital-marketing',
                    'uri'               => null,
                    'template'          => null,
                    'status'            => 'published',
                    'position'          => 6,
                    'created_at'        => $now
                ],

                [
                    'website_object_id' => 207,
                    'parent_id'         => null,
                    'object_id'         => 7,
                    'object_type'       => SimpleLink::class,
                    'content_type'      => 'simpleLink',
                    'slug'              => 'blog-article-left',
                    'uri'               => null,
                    'template'          => null,
                    'status'            => 'published',
                    'position'          => 7,
                    'created_at'        => $now
                ],
                [
                    'website_object_id' => 208,
                    'parent_id'         => null,
                    'object_id'         => 8,
                    'object_type'       => SimpleLink::class,
                    'content_type'      => 'simpleLink',
                    'slug'              => 'blog-article-right',
                    'uri'               => null,
                    'template'          => null,
                    'status'            => 'published',
                    'position'          => 8,
                    'created_at'        => $now
                ],

                [
                'website_object_id' => 209,
                'parent_id'         => null,
                'object_id'         => 9,
                'object_type'       => SimpleLink::class,
                'content_type'      => 'simpleLink',
                'slug'              => 'lnk-discovery',
                'uri'               => null,
                'template'          => null,
                'status'            => 'published',
                'position'          => 9,
                'created_at'        => $now
            ],
            [
                'website_object_id' => 210,
                'parent_id'         => null,
                'object_id'         => 10,
                'object_type'       => SimpleLink::class,
                'content_type'      => 'simpleLink',
                'slug'              => 'lnk-strategy',
                'uri'               => null,
                'template'          => null,
                'status'            => 'published',
                'position'          => 10,
                'created_at'        => $now
            ],
            [
                'website_object_id' => 211,
                'parent_id'         => null,
                'object_id'         => 11,
                'object_type'       => SimpleLink::class,
                'content_type'      => 'simpleLink',
                'slug'              => 'lnk-design',
                'uri'               => null,
                'template'          => null,
                'status'            => 'published',
                'position'          => 11,
                'created_at'        => $now
            ],
            [
                'website_object_id' => 212,
                'parent_id'         => null,
                'object_id'         => 12,
                'object_type'       => SimpleLink::class,
                'content_type'      => 'simpleLink',
                'slug'              => 'lnk-development',
                'uri'               => null,
                'template'          => null,
                'status'            => 'published',
                'position'          => 12,
                'created_at'        => $now
            ],
            [
                'website_object_id' => 213,
                'parent_id'         => null,
                'object_id'         => 13,
                'object_type'       => SimpleLink::class,
                'content_type'      => 'simpleLink',
                'slug'              => 'lnk-branding',
                'uri'               => null,
                'template'          => null,
                'status'            => 'published',
                'position'          => 13,
                'created_at'        => $now
            ],
            [
                'website_object_id' => 214,
                'parent_id'         => null,
                'object_id'         => 14,
                'object_type'       => SimpleLink::class,
                'content_type'      => 'simpleLink',
                'slug'              => 'lnk-marketing',
                'uri'               => null,
                'template'          => null,
                'status'            => 'published',
                'position'          => 14,
                'created_at'        => $now
            ],
            ]
        );

        DB::table($this->websiteLangTable)->insert(
            [
                [
                    'wo_translation_id' => 201,
                    'website_object_id' => 201,
                    'wo_language_id'    => 'en',
                    'lang_slug'         => 'lnk-discovery-exploration',
                    'lang_uri'          => null,
                ],
                [
                    'wo_translation_id' => 202,
                    'website_object_id' => 202,
                    'wo_language_id'    => 'en',
                    'lang_slug'         => 'lnk-digital-solutions-strategy',
                    'lang_uri'          => null,
                ],
                [
                    'wo_translation_id' => 203,
                    'website_object_id' => 203,
                    'wo_language_id'    => 'en',
                    'lang_slug'         => 'lnk-prototyping-design',
                    'lang_uri'          => null,
                ],
                [
                    'wo_translation_id' => 204,
                    'website_object_id' => 204,
                    'wo_language_id'    => 'en',
                    'lang_slug'         => 'lnk-digital-development',
                    'lang_uri'          => null,
                ],
                [
                    'wo_translation_id' => 205,
                    'website_object_id' => 205,
                    'wo_language_id'    => 'en',
                    'lang_slug'         => 'lnk-digital-branding',
                    'lang_uri'          => null,
                ],
                [
                    'wo_translation_id' => 206,
                    'website_object_id' => 206,
                    'wo_language_id'    => 'en',
                    'lang_slug'         => 'lnk-digital-marketing',
                    'lang_uri'          => null,
                ],

                [
                    'wo_translation_id' => 207,
                    'website_object_id' => 207,
                    'wo_language_id'    => 'en',
                    'lang_slug'         => 'blog-article-left',
                    'lang_uri'          => null,
                ],
                [
                    'wo_translation_id' => 208,
                    'website_object_id' => 208,
                    'wo_language_id'    => 'en',
                    'lang_slug'         => 'blog-article-right',
                    'lang_uri'          => null,
                ],

                [
                    'wo_translation_id' => 209,
                    'website_object_id' => 209,
                    'wo_language_id'    => 'en',
                    'lang_slug'         => 'lnk-discovery',
                    'lang_uri'          => null,
                ],
                [
                    'wo_translation_id' => 210,
                    'website_object_id' => 210,
                    'wo_language_id'    => 'en',
                    'lang_slug'         => 'lnk-strategy',
                    'lang_uri'          => null,
                ],
                [
                    'wo_translation_id' => 211,
                    'website_object_id' => 211,
                    'wo_language_id'    => 'en',
                    'lang_slug'         => 'lnk-design',
                    'lang_uri'          => null,
                ],
                [
                    'wo_translation_id' => 212,
                    'website_object_id' => 212,
                    'wo_language_id'    => 'en',
                    'lang_slug'         => 'lnk-development',
                    'lang_uri'          => null,
                ],
                [
                    'wo_translation_id' => 213,
                    'website_object_id' => 213,
                    'wo_language_id'    => 'en',
                    'lang_slug'         => 'lnk-branding',
                    'lang_uri'          => null,
                ],
                [
                    'wo_translation_id' => 214,
                    'website_object_id' => 214,
                    'wo_language_id'    => 'en',
                    'lang_slug'         => 'lnk-marketing',
                    'lang_uri'          => null,
                ],
            ]
        );
    }
}
