<?php

/* @var $factory \Illuminate\Database\Eloquent\Factory */

use App\Models\BlockLanguage;
use Faker\Generator as Faker;

$factory->define(BlockLanguage::class, function (Faker $faker, $options) {
    return [];
});

$factory->state(BlockLanguage::class, 'blockWysiwyg', function($faker) {
    return _getBlockLanguageData('blockWysiwyg', $faker);
});

$factory->state(BlockLanguage::class, 'blockLocation', function($faker) {
    return _getBlockLanguageData('blockLocation', $faker);
});

$factory->state(BlockLanguage::class, 'blockSlider', function($faker) {
    return _getBlockLanguageData('blockSlider', $faker);
});


if(!function_exists("_getBlockLanguageData")) {
    function _getBlockLanguageData($type, $faker) {
        $blockData = [];
        $blockData['title'] = $faker->realText(150);
        $blockData['block_title'] = $faker->realText(200);
        $blockData['wysiwyg'] = "";
        switch ($type) {
            case 'blockWysiwyg':
                $blockData['wysiwyg'] = $faker->realText();
                break;
            case 'blockLocation':
                break;
            case 'blockSlider':
                break;
        }
        return $blockData;
    }
}
