Q: Laravel - Query Buider - SQL fields using LPAD statement I'm cannot retry this query, in QueryBuilder:
select id, lpad(number, 12, 0), lpad(int, 2, 0) from users;
How I can, in the example not function...
DB::table('users') ->select('id', 'lpad(number, 12, 0)', 'lpad(int, 2, 0)' ->get();

A: You need to use selectRaw.
DB::table('users')
    ->selectRaw('id, lpad(number, 12, 0), lpad(int, 2, 0)')
    ->get();

https://laravel.com/docs/8.x/queries#selectraw
