MartinZeltin
2 months ago
211
10
Eloquent

Call to a member function toSql() on array

Posted 2 months ago by MartinZeltin

Hello, I am trying to use the toSql() function for Query Builder but it is not working. I get an error

Call to a member function toSql() on array

Here is my query

$replies = DB::connection('second_connection')
            ->select("
                 SELECT id, reply_text, sending_time
                 FROM inbox_replies
            ");

dump($replies->toSql());

It works on Eloquent but not for raw DB query like this. What am I doing wrong here?

Please sign in or create an account to participate in this conversation.