Laravel adds single quotes around my orderBy which is causing the query to not execute as expected
I have tried numerous combinations of using DB::raw while trying to remove the single quotes from my select statement and got nowhere.
<?php
$sql = "SELECT cust_name, ad_text, total_sms FROM customers WHERE created_at > :startDate AND created_at < :endDate ORDER BY :orderBy DESC;";
return DB::Select($sql, ['startDate'=>$startDate,'endDate'=>$endDate, 'orderBy' => $orderBy]);?>
which comes out to
ORDER BY 'total_sms' DESC;
How do i escape this binding param so its single quotes are removed?