original_string: public function index(Request $request)
  	{
  		//filter products by the given query.
  		$response['products']['results'] = $this->products->filter([
  			'search' => $request->get('q')
  		], 4)->get();
  
  		//filter categories by the given query.
  		$response['products']['categories'] = app('category.repository.cahe')->categoriesWithProducts([
  			'name' => $request->get('q'),
  			'description' => $request->get('q'),
  		], 4, ['id', 'name']);
  
  		$response['products']['suggestions'] = Suggestions\Suggest::for('my_searches')->shake()->get('my_searches');
  
  		$response['products']['categories_title'] = trans('globals.suggested_categories');
          $response['products']['suggestions_title'] = trans('globals.suggested_products');
          $response['products']['results_title'] = trans('globals.searchResults');
  
  		return $response;
  	}
code: public function index(Request $request)
  	{
  		//filter products by the given query.
  		$response['products']['results'] = $this->products->filter([
  			'search' => $request->get('q')
  		], 4)->get();
  
  		//filter categories by the given query.
  		$response['products']['categories'] = app('category.repository.cahe')->categoriesWithProducts([
  			'name' => $request->get('q'),
  			'description' => $request->get('q'),
  		], 4, ['id', 'name']);
  
  		$response['products']['suggestions'] = Suggestions\Suggest::for('my_searches')->shake()->get('my_searches');
  
  		$response['products']['categories_title'] = trans('globals.suggested_categories');
          $response['products']['suggestions_title'] = trans('globals.suggested_products');
          $response['products']['results_title'] = trans('globals.searchResults');
  
  		return $response;
  	}
code_tokens: public function index ( Request $ request ) { //filter products by the given query. $ response [ 'products' ] [ 'results' ] = $ this -> products -> filter ( [ 'search' => $ request -> get ( 'q' ) ] , 4 ) -> get ( ) ; //filter categories by the given query. $ response [ 'products' ] [ 'categories' ] = app ( 'category.repository.cahe' ) -> categoriesWithProducts ( [ 'name' => $ request -> get ( 'q' ) , 'description' => $ request -> get ( 'q' ) , ] , 4 , [ 'id' , 'name' ] ) ; $ response [ 'products' ] [ 'suggestions' ] = Suggestions \ Suggest :: for ( 'my_searches' ) -> shake ( ) -> get ( 'my_searches' ) ; $ response [ 'products' ] [ 'categories_title' ] = trans ( 'globals.suggested_categories' ) ; $ response [ 'products' ] [ 'suggestions_title' ] = trans ( 'globals.suggested_products' ) ; $ response [ 'products' ] [ 'results_title' ] = trans ( 'globals.searchResults' ) ; return $ response ; }
docstring: Loads the products search.
  
  @return void
docstring_tokens: Loads the products search .