samedi 22 juin 2019

How to make this SQL query in Laravel

I have this query that works well, but how do I do it in Laravel?

SELECT * FROM IGNom_Trabajador 
    WHERE REPLACE(CODE, '.', '') = 12345678

I've tried the following statements, but they don't work.

$user = DB
    ::connection('sqlsrv')
    ->select(DB::raw(
        'SELECT * FROM IGNom_Trabajdor WHERE REPLACE(CODE, ".", "") = $auth->ci'
    ));

$user = Employee
    ::where(/DB::raw(REPLACE('CODE', '.', ''), '=', '24883967')
    ->first();



from Newest questions tagged laravel-5 - Stack Overflow http://bit.ly/2ZJBbvI
via IFTTT

Aucun commentaire:

Enregistrer un commentaire