S
S
SvizzZzy2018-07-02 11:10:01
Laravel
SvizzZzy, 2018-07-02 11:10:01

How to do ltrim in laravel leftjoin?

Hello.
There is a request like this:

$builder->leftjoin('public.table as test', function ($join) {
            $join->on('test.field1', '=', 'table2.field1')
                    ->on('test.filed2', '=', 'table2.field2');
        });

How can one write for table2.field1 ltrim(table2.field1,'0') or str_replace ?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
Gleb Starkov, 2018-07-02
@SvizzZzy

Do LTRIM at the DB level via DB::Raw()

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question