jeudi 24 octobre 2019

dd($candidateinfo) is showing null. i want to someone to check whether i am using correct join-query for getting data on the page

My controller Function is below shown. Donar() is the modal used to store data it is working properly.

    public function basket(Request $request, $candidateinfo_id)
    {
    $donar = new Donar();
    $donar->candidateinfo_id = $request->input('candidateinfo_id');
    $donar->donation_as = $request->input('donation_as');
    $donar->amount_donation = $request->input('txtvalue');
    $donar->save();

    $candidateinfo= DB::table('candidateinfo')
    ->join('projectdetails','candidateinfo.id','=',
    'projectdetails.candidateinfo_id')
    ->join('loandetails','loandetails.candidateinfo_id',
    '=','candidateinfo.id')
    ->join('verifications','verifications.candidateinfo_id','=',
     'candidateinfo.id')
    ->join('donarinfo','donarinfo.candidateinfo_id',
     '=','candidateinfo.id')
    ->select('candidateinfo.*' ,'candidateinfo.id AS 
      candidateinfo_id', 'projectdetails.*','loandetails.*',
     'verifications.*','donarinfo.*')
    ->where('candidateinfo.id',$candidateinfo_id)
    ->first();
    dd($candidateinfo);
     return view('main.review',compact('candidateinfo'));
    }

dd($candidateinfo) returns null. Am I using the correct join-query?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire