I'm trying to set a boolean $bln
according to whether a record exists in a table.
This is what I've been trying:
$bln = (bool) DB::table('accounts')->where('name', $name)->pluck('id');
For some reason $bln
always seems to be set to true
. What am I doing wrong?
via Urbycoz