Laravel generate category list from product results
Your search query will not be able to leverage an index on the fields you are searching within.  This is because you have a wildcard at the beginning of the search string and a default B-Tree index only works for prefix match use cases.  So when the LIKE condition has a wild card at the beginning, you will need to perform a full table scan.  Full table scans are REALLY bad from a performance standpoint.

It looks like you use case would work best with natural language full text search (MySQL link here - http://dev.mysql.com/doc/refman/5.7/en/fulltext-natural-language.html ).  This would require change to both your query and the database schema.

You also do a lot of individual single table queries here.  My guess is that you can possibly optimize this by utilizing joins to get date across table with a single (or fewer queries) vs. reading data from one table, then another based on that result, then another based on that next result, etc.