Level 75
Is it not clear for you?
public function getTransactionComments()
{
return Comment::with(['payment', 'club'])->orderBy('created_at')->get();
}
2 likes
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
{"error":"Failed to get comments for transactions - Method Illuminate\Database\Eloquent\Collection::with does not exist."}
public function getTransactionComments()
{
$query = Comment::get();
$comments = $query->with('payment')->with('club')->orderBy('created_at', 'ASC');
return $comments;
}
Is it not clear for you?
public function getTransactionComments()
{
return Comment::with(['payment', 'club'])->orderBy('created_at')->get();
}
Please or to participate in this conversation.