app/Http/Controllers/Admin/UserInformationController.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(Request $request)
    {
        if(isset($request->gender) && $request->gender!='')
        {
        $data['question'] = Question::where('status','Active')->where('editedable','1')->get();
        $data['questionId'] = Question::where('status','Active')->where('editedable','1')->pluck('id')->toArray();
        $data['userInformation'] = UserInformation::where('status','Active')->where('gender',$request->gender)->paginate(30);
        }
        else
        {
        $data['question'] = Question::where('status','Active')->where('editedable','1')->get();
        $data['questionId'] = Question::where('status','Active')->where('editedable','1')->pluck('id')->toArray();
        $data['userInformation'] = UserInformation::where('status','Active')->paginate(30); 
        }
        return view('admin.userInformation.index')->with('data',$data);
    }
public function index ( Request $ request ) { if ( isset ( $ request -> gender ) && $ request -> gender != '' ) { $ data [ 'question' ] = Question :: where ( 'status' , 'Active' ) -> where ( 'editedable' , '1' ) -> get ( ) ; $ data [ 'questionId' ] = Question :: where ( 'status' , 'Active' ) -> where ( 'editedable' , '1' ) -> pluck ( 'id' ) -> toArray ( ) ; $ data [ 'userInformation' ] = UserInformation :: where ( 'status' , 'Active' ) -> where ( 'gender' , $ request -> gender ) -> paginate ( 30 ) ; } else { $ data [ 'question' ] = Question :: where ( 'status' , 'Active' ) -> where ( 'editedable' , '1' ) -> get ( ) ; $ data [ 'questionId' ] = Question :: where ( 'status' , 'Active' ) -> where ( 'editedable' , '1' ) -> pluck ( 'id' ) -> toArray ( ) ; $ data [ 'userInformation' ] = UserInformation :: where ( 'status' , 'Active' ) -> paginate ( 30 ) ; } return view ( 'admin.userInformation.index' ) -> with ( 'data' , $ data ) ; }
Display a listing of the resource.
Display a listing of the resource .