I'm trying to get a value from database using the following code
$request = Registrationrequest::where('course_id', $id)
->where('user_id', Auth::user()->id)
->where('registered', true)->count();
I'm using Laravel. I have a row with course_id = 4, user_id=3 and registered=true.
When I var_dump each values separately, I'm confirming it. But when I use this where condition together, I'm not getting the count value as 1, instead getting 0.
I have another query where I use
$request = Registrationrequest::where('course_id', $id)
->where('user_id', Auth::user()->id)
->where('registered', false)->first();
This works perfect when the registered value is false.
Can anybody tell me where am I wrong?
registeredcolumn's type (in the database)?1instead oftrue, and0instead offalse?