I have a relationship defined in laravel - Warehouse - Product, when I search for text strings to compare with the product description, and I add spaces it does not filter correctly.
This I tried and Other question. but it doesn't filter me correctly
Warehouse::whereHas('item', function($query) use($search,$column) {
//$query->whereRaw(DB::raw("LOWER(REPLACE(description, ' ', '')) LIKE CONCAT('%',LOWER(REPLACE('".$search."', ' ', '')), '%')" ));
// $search = 'la es';
$query->where( $column, 'LIKE','%'.str_replace(' ', '', $search).'%');
})
->orderBy('item_id')
->get()
from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/3kCYeSG
via IFTTT
Aucun commentaire:
Enregistrer un commentaire