original_string: protected function forCategories() : array
  	{
  		$categories = $this->products->pluck('category');
  
  		return $categories->mapWithKeys(function ($item) use ($categories) {
  
  				$result[$item->id] = [
  					'id' => $item->id,
  					'name' => $item->name,
  					'qty' => $categories->where('id', $item->id)->count()
  				];
  
  				return $result;
  		})->all();
  	}
code: protected function forCategories() : array
  	{
  		$categories = $this->products->pluck('category');
  
  		return $categories->mapWithKeys(function ($item) use ($categories) {
  
  				$result[$item->id] = [
  					'id' => $item->id,
  					'name' => $item->name,
  					'qty' => $categories->where('id', $item->id)->count()
  				];
  
  				return $result;
  		})->all();
  	}
code_tokens: protected function forCategories ( ) : array { $ categories = $ this -> products -> pluck ( 'category' ) ; return $ categories -> mapWithKeys ( function ( $ item ) use ( $ categories ) { $ result [ $ item -> id ] = [ 'id' => $ item -> id , 'name' => $ item -> name , 'qty' => $ categories -> where ( 'id' , $ item -> id ) -> count ( ) ] ; return $ result ; } ) -> all ( ) ; }
docstring: Parses the category filter.
  
  @return array
docstring_tokens: Parses the category filter .