Use debugbar to see what query is actually being run
Jan 23, 2022
5
Level 3
Simple query returns empty array no matter what
I have a simple query:
ItemsList::query()->where('account_id', '==', $this->user()->account_id)->get();
But I always get
Illuminate\Database\Eloquent\Collection {#1952
#items: []
#escapeWhenCastingToString: false
}
I checked and $this->user()->account_id returns the correct id, and in the table that corresponds to the model itemList there is definitely a column account_id and there is the correct id that is shown from the above command ($this->user()->account_id)
Please or to participate in this conversation.