jeudi 8 février 2018

How to remove quotes in between using eloquent laravel?

I'm trying to remove the quotes in the sentence between using eloquent in laravel:

public function scopeGetOptionCommission($query, $params, $range)
{
    $query->where('column1', $params->foo);
    $query->where('column2', $params->bar);
    $query->whereRaw('? BETWEEN rangeA and rangeB', [$range]);

    return $query;
}

in sql I get this:

select 
   * 
from 
   `table1` 
where 
    `column1` = 'foo' and 
    `column2` = 'bar' and 
    '60' BETWEEN rangoi and rangof

but I want to get the value of range without the quotes



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire