<?php

namespace App\Http\Controllers;

use App\Http\Requests;
use Illuminate\Http\Request;
use DB;
use Carbon\Carbon;
use Session;
use App;

class WelcomeController extends Controller
{
    /**
     * Create a new controller instance.
     *
     * @return void
     */
    public function __construct()
    {
        //$this->middleware('auth');
    }

    /**
     * Show the application dashboard.
     *
     * @return \Illuminate\Http\Response
     */
    public function index()
    {
        if (Session::has('lang')){
            $lang = Session::get('lang');
             
            App::setLocale($lang);
        }else{

            Session::put('lang','en');
            $lang = Session::get('lang');
            
            App::setLocale($lang);
        }
        return view('welcome');  
    }
    
    public function about_us()
    {
        $lang = Session::get('lang');
        App::setLocale($lang);
        
        return view('aboutus');
    }

    public function our_services()
    {
        $lang = Session::get('lang');
        App::setLocale($lang);
        return view('services');
    }

    public function safty_policy()
    {
        $lang = Session::get('lang');
        App::setLocale($lang);
        return view('safty_policy');
    }
    
    
    
    public function policy_data()
    {
        $lang = Session::get('lang');
        App::setLocale($lang);
        return view('policy_data');
    }

    public function goal()
    {
        $lang = Session::get('lang');
        App::setLocale($lang);
        return view('goal');
    }

    public function vision()
    {
        $lang = Session::get('lang');
        App::setLocale($lang);
        return view('vision');
    }

    public function env_sus()
    {
        $lang = Session::get('lang');
        App::setLocale($lang);
        return view('env_sus');
    }

    public function eg_waste()
    {
        $lang = Session::get('lang');
        App::setLocale($lang);
        return view('egwaste');
    }


    public function change_language($lang)
    {
        Session::put('lang',$lang);
        App::setLocale($lang);
        return view('welcome'); 
       
    }

    public function not_sent_to_customer()
    {
                 
       
    }



    public function sent_to_customer()
    {
                 
         
    }

    public function login()
    {
        $lang = Session::get('lang');
        App::setLocale($lang);
        return view('auth.login');
    }
 
    public function login_post()
    {
        
    }
    
    public function notfound()
    {
        return view('404' );
    }
}
