Eloquent is using 'Bind Parameters' in the PDO library. The ? is s placeholder for the data that will be supplied by the bind variable. What is the Full SQL error you are getting?
@haroon-mahmood-4276 I know we're both answering a 4 year old question, but you may be interested in adding this method in your model which will allow you to access the query in a format you can run directly in mysql.
@automica If we are in older versions of Laravel, then your given piece of code would do the trick. But from Laravel v10, they've added two functions dumpRawSql() and ddRawSql. Those methods may be invoked on a query to dump the query's SQL with all parameter bindings properly substituted