laravelwhere-clauseclause

laravel controller not returning data but the condition in the where clause is true?


I am using laravel 9x. I made the condition where(email,'Auth::user()->email)->where('active','!=',3)->get();

there is a lot of data where active is not equal to 3 but still, it's not returning any data.


Solution

  • When you want to use not equal in the builder you should use '<>' instead of '!=';