original_string: public static function collection($resource)
      {
          return tap(new AnonymousResourceCollection($resource, static::class), function ($collection) {
              if (property_exists(static::class, 'preserveKeys')) {
                  $collection->preserveKeys = (new static([]))->preserveKeys === true;
              }
          });
      }
code: public static function collection($resource)
      {
          return tap(new AnonymousResourceCollection($resource, static::class), function ($collection) {
              if (property_exists(static::class, 'preserveKeys')) {
                  $collection->preserveKeys = (new static([]))->preserveKeys === true;
              }
          });
      }
code_tokens: public static function collection ( $ resource ) { return tap ( new AnonymousResourceCollection ( $ resource , static :: class ) , function ( $ collection ) { if ( property_exists ( static :: class , 'preserveKeys' ) ) { $ collection -> preserveKeys = ( new static ( [ ] ) ) -> preserveKeys === true ; } } ) ; }
docstring: Create new anonymous resource collection.
  
  @param  mixed  $resource
  @return \Illuminate\Http\Resources\Json\AnonymousResourceCollection
docstring_tokens: Create new anonymous resource collection .