Skip to content

What is the wrong #15162

Answered by Ardhan2121
tahinuralam asked this question in Help
Dec 22, 2024 · 2 comments · 1 reply
Discussion options

You must be logged in to vote

Result::where('roll_no', 149202)->get() returns a collection (Collection).
However, the infolist->record method expects a parameter of type \Illuminate\Database\Eloquent\Model. This mismatch causes the error.

To fix it, use Result::where('roll_no', 149202)->first() instead, as it returns a single model rather than a collection.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@tahinuralam
Comment options

Answer selected by tahinuralam
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
3 participants