'how to filter a table using row value=NULL in laravel controller

   public function complaint_pending(){

    $complaints = Complaint::whereNull('answear')->get();

    return view('admin.complaint.panding',compact('complaints'));

   }

I want to show Complaint all data which answer row is NULL

My DB pic is below

enter image description here



Solution 1:[1]

you have type error in function.

change answear to answer in complaint_pending method.

Solution 2:[2]

That's not work but it's work perfectly ...

  public function complaint_pending(){
    
    $complaints = Complaint::where('answear', NULL)->get();
    
    return view('admin.complaint.panding',compact('complaints'));
    }

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Mohammad Gitipasand
Solution 2 Morshedul Aziz