app/Http/Controllers/FrontendController.php
/**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
Display a listing of the resource.
@return \Illuminate\Http\Response
Display a listing of the resource . @return \ Illuminate \ Http \ Response
public function index()
    {
        if(!array_key_exists('DB_HOST',$_SERVER))
            throw new Exception("Please Check Your APP Envirnment!");
        if($_SERVER['DB_HOST'] != '127.0.0.1' && !check_internet()['success'])
            return check_internet();
        $survey = Survey::where('is_active',1)
                ->whereDate('end_date','>=',date('Y-m-d'))
                ->first();
        $surveys = Survey::latest()->paginate(12);
        return view('frontend.home',compact('survey','surveys'));
    }
public function index ( ) { if ( ! array_key_exists ( 'DB_HOST' , $ _SERVER ) ) throw new Exception ( " Please Check Your APP Envirnment! " ) ; if ( $ _SERVER [ 'DB_HOST' ] != '127.0.0.1' && ! check_internet ( ) [ 'success' ] ) return check_internet ( ) ; $ survey = Survey :: where ( 'is_active' , 1 ) -> whereDate ( 'end_date' , '>=' , date ( 'Y-m-d' ) ) -> first ( ) ; $ surveys = Survey :: latest ( ) -> paginate ( 12 ) ; return view ( 'frontend.home' , compact ( 'survey' , 'surveys' ) ) ; }
Display a listing of the resource.
Display a listing of the resource .