<?php namespace App\Http\Controllers;

    use Session;
	use Request;
	use DB;
	use Carbon;

    class WelcomeController extends Controller {
        public function getIndex() {
            $data = [];
            $data['app_name'] = "SILAKHI";
            
            $data['banner'] = DB::table('main_page')->where('section','banner')->first();
            $data['about'] = DB::table('main_page')->where('section','about')->first();
            $data['tutorial'] = DB::table('main_page')->where('section','tutorial')->first();
            $data['layanan'] = DB::table('surat')->where('owner_priv',46)->orderBy('urutan')->get();
            $data['kegiatan'] = DB::table('media')
                                            ->join('kegiatan','kegiatan.id','media.id_ortu')
                                            ->where('media.created_by_priv',46)
                                            ->get();

            $data['modal'] = DB::table('main_page')->where('section','modal')->first();
            
            return view('welcome',$data);
        }
    }