Why doesn't it correctly filter items in a hasOne Laravel relation using spaces blanks

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

تعليقات

المشاركات الشائعة من هذه المدونة

I am unable to figure out how to create payment collection request, after a form has been submitted in laravel

laravel, mysql transaction not working after failed one time