I have this code:
$u_t = User::where('set', '1')->get();
When I die and dump dd($u_t) I get the following:
Collection {#159 ▼
#items: array:1 [▼
0 => set {#158 ▶}
]
}
This is good so far. Now when I replace the "1" with some gibberish, like so: $u_t = User::where('set', 'adsfljasdlkf')->get();
I get:
Collection {#164 ▼
#items: []
}
I don't really get null. How can I return null?
Edit: when I do ->first() instead of ->get(), I get null if I enter junk. I don't get null if I replace it with ->get().