Friday, April 14, 2017

unable to search name with short name

we have a table where names are like

Hyper Text Markup Language

Cascading Style Sheets

Active Server Pages

Java Server Pages

now we want to search them with short name also like

html

css

asp

jsp

so we created a column for short name, but our laravel query is not working properly, can you help what is the issue with it?

$names = Language::where('short_name','like','%' . $name . '%')
        ->orWhere('name','like','%' . $name . '%')
        ->where('public','=',1)
    ->limit($limit)
    ->get();



via fewBugs

Advertisement