You can apply the same solution as already given to you in this thread.
In the articles controller you could extract this part of query in a scope
::where('title', 'like', '%' . $qry . '%') ->orWhere('short_description', 'like', '%' . $qry . '%') ->orWhere('content', 'like', '%' . $qry . '%')
In the blade, you could extract what is inside the foreach in another blade
Sign in to participate in this thread!
We'd like to thank these amazing companies for supporting us