what's wrong is you're trying to do an SQL injection into your own query. Try doing it this way:
return $query->leftJoin('table1', function($q) {
$q->on(DB::raw("REPLACE(table2.serialnumber, '123HM', 'HM') = database.table1.SerialNumber"))
});
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community