Level 1
Nevermind, my IF statement was backwards in my local project..
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
When I use the following query:
$user_id = auth()->user()->id;
$profiles = Profile::where('user_id', '=' ,$user_id)->get();
It always returns this when I use print_r to check:
Illuminate\Database\Eloquent\Collection Object ( [items:protected] => Array ( ) )
This means that I cannot use count, because it will always return true.
@if(count($profiles))
not empty
@else
empty
@endif
Am I doing something wrong?
Nevermind, my IF statement was backwards in my local project..
Please or to participate in this conversation.