Support the ongoing development of Laravel.io →
Database Eloquent
Last updated 1 year ago.
0

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"))
});
Last updated 7 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

prodigy7 prodigy7 Joined 7 Feb 2017

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.