mardi 31 mai 2016

Laravel 5 Simple Comparison Fails

This should be simple but for some reason code in my if block is executing despite the fact that it resolves to false and it's making me very unhappy... My user_id in this case is 2.

$note = Notification::where("user_id",Auth::user()->id)->first();
$wall = $note->pluck('wall');
if($wall != 0)
{
//This code is executing!
}
else{
    array_push($data,"Your First Time!");   
    //This code is not!
}

As you can see, my $wall should be zero so I don't understand why $wall != 0 runs.

enter image description here



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire