<?php

namespace App\Http\Controllers;

use Illuminate\Support\Facades\Cache;
use Lipsum;

class WelcomeController extends Controller
{
	private $cachetime = 86400;

	private function _sample_data() {
		return [
	        'site_aboutus'=>Cache::remember(md5(__METHOD__.'aboutus'),$this->cachetime,function() { return Lipsum::short()->text(3); }),
			'site_address'=>'1 Road Street,<br>Town or City, State, Postcode<br>Country',
			'site_description'=>Cache::remember(md5(__METHOD__.'aboutus'),$this->cachetime,function() { return Lipsum::short()->text(1); }),
			'site_email'=>'sales@example.com',
			'site_fax'=>'+1 234 567 8910',
			'site_logo'=>'/image/generic/150/20/fff',
			'site_phone'=>'+1 234 567 8910',
	        'site_slider'=>TRUE,
			'site_social'=>[['name'=>'facebook','url'=>'#'],['name'=>'twitter','url'=>'#']],
			'site_topmenu'=>['Option1'=>['url'=>'#','name'=>'a'],'Option 2'=>['url'=>'#','name'=>'List','children'=>[['url'=>'#','name'=>'A'],['url'=>'#','name'=>'B']]]],
			'page_activity'=>[
				[
					'image_small'=>'/image/generic/150/100/fff',
					'image_large'=>'/image/generic/450/200/aaa',
					'title'=>'Title',
					'subtitle'=>'Subtitle',
				],
				[
					'image_small'=>'/image/generic/150/100/eee',
					'image_large'=>'/image/generic/650/200/999',
					'title'=>'Title',
					'subtitle'=>'Subtitle',
				],
				[
					'image_small'=>'/image/generic/150/100/ddd',
					'image_large'=>'/image/generic/850/300/888',
					'title'=>'Title',
					'subtitle'=>'Subtitle',
				],
				[
					'image_small'=>'/image/generic/150/100/ccc',
					'image_large'=>'/image/generic/450/200/777',
					'title'=>'Title',
					'subtitle'=>'Subtitle',
				],
			],
			'page_activityintro'=>'Here are some of the the things we\'ve been doing',
			'page_blockquote'=>[
				[
					'title'=>'Block Quote',
					'icon'=>'fa fa-rocket',
					'image'=>'/image/generic/150/75/ddd',
				],
			],
			'page_servicebox'=>[
				[
					'title'=>'Box 1',
					'icon'=>'fa fa-location-arrow blue',
					'image'=>'/image/generic/200/100/999',
					'text'=>Cache::remember(md5(__METHOD__.'aboutus'),$this->cachetime,function() { return Lipsum::short()->text(3); }),
				],
				[
					'title'=>'Box 2',
					'icon'=>'fa fa-location-arrow blue',
					'image'=>'/image/generic/200/100/999',
					'text'=>Cache::remember(md5(__METHOD__.'aboutus'),$this->cachetime,function() { return Lipsum::short()->text(3); }),
				],
				[
					'title'=>'Box 3',
					'icon'=>'fa fa-location-arrow blue',
					'image'=>'/image/generic/200/100/999',
					'text'=>Cache::remember(md5(__METHOD__.'aboutus'),$this->cachetime,function() { return Lipsum::short()->text(3); }),
				],
			],
			'page_steps'=>[
				[
					'title'=>'Step 1',
					'description'=>Cache::remember(md5(__METHOD__.'aboutus'),$this->cachetime,function() { return Lipsum::short()->text(1); }),
				],
				[
					'title'=>'Step 2',
					'description'=>Cache::remember(md5(__METHOD__.'aboutus'),$this->cachetime,function() { return Lipsum::short()->text(1); }),
				],
				[
					'title'=>'Step 3',
					'description'=>Cache::remember(md5(__METHOD__.'aboutus'),$this->cachetime,function() { return Lipsum::short()->text(1); }),
				],
			],
			'page_tabs'=>[
				[
					'title'=>'Title #1',
					'image'=>'/image/generic/200/100/999/1.jpg',
					'text'=>Cache::remember(md5(__METHOD__.'aboutus'),$this->cachetime,function() { return Lipsum::short()->text(1); }),

				],
				[
					'title'=>'Title #2',
					'image'=>'/image/generic/200/100/999/1.jpg',
					'text'=>Cache::remember(md5(__METHOD__.'aboutus'),$this->cachetime,function() { return Lipsum::short()->text(1); }),

				],
				[
					'title'=>'Title #3',
					'image'=>'/image/generic/200/100/999/1.jpg',
					'text'=>Cache::remember(md5(__METHOD__.'aboutus'),$this->cachetime,function() { return Lipsum::short()->text(1); }),

				],
			],
			'page_testimonials'=>[
				[
					'name'=>'First Last #1',
					'title'=>'Title',
					'photo'=>'/image/generic/200/100/999',
					'quote'=>Cache::remember(md5(__METHOD__.'aboutus'),$this->cachetime,function() { return Lipsum::short()->text(1); }),
				],
				[
					'name'=>'First Last #2',
					'title'=>'Title',
					'photo'=>'/image/generic/200/100/333',
					'quote'=>Cache::remember(md5(__METHOD__.'aboutus'),$this->cachetime,function() { return Lipsum::short()->text(1); }),
				],
			],
			'page_title'=>'Welcome',
		];
	}

    /**
     * Show the application splash screen.
     *
     * @return Response
     */
    public function show()
    {
        return view('welcome',$this->_sample_data());
    }
}
