vendredi 25 mars 2016

Escape Laravel DB:raw query using Eloquent Where

How do I escape the following query in Laravel, using Eloquent:

$someCollection->where(DB::raw("CONCAT(`field1`, ' ', `field2`)"), 'LIKE', "%".$user_input."%");

I'm wondering if Eloquent's where method is escaping the $user_input parameter, even when using DB::raw like this. Any ideas?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire