I'm trying to get the query with the field 'Active = S', and have the result of that have 'BusinessName lilke $request->search' or 'Label like $request->search'
I think there must be a maybe nested way to do it
Thanks for your Help! Here is the code:
$afiliates = DB::table('ad_afiliado')
->select('logo_url', 'NombreComercial', 'Destacado', 'id_afiliado', 'Clave','Activo')
->where('Activo','=', 'S')
->where('NombreComercial','like', '%' . $request->search . '%')
->where('Etiqueta', 'like', '%' . $request->search . '%')
->orderBy('CLAVE', $request->order)
->paginate(9);
This way I'm doing force to acomplish all "where's" and I want to acomplish always 'Activo = S' , and any of 'NombreComercial like' or 'Etiqueta like'
I'm using LARAVEL 7