mercredi 21 décembre 2016

Unable to pass multiple values in not like clause Laravel

I am working on a Laravel project and want to post multiple values in a not like clause.
I have tried the following way with no success.

    $exclude_emails=['%odz%', '%test.com%'];

    $vendors=\DB::table("vendor_infos")
              ->where("vendor_infos.email", 'not like', '%'.$exclude_emails.'%' )
              ->orderByRaw("RAND()")->take(8)->get(['vendor_infos.*']);

I have also tried to pass it as string, but still no success,

Please let me know where i am wrong.

Thanks.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire