original_string: public static function collectFieldAssets()
      {
          if (!empty(static::$collectedAssets)) {
              return static::$collectedAssets;
          }
  
          $css = collect();
          $js = collect();
  
          foreach (static::$availableFields as $field) {
              if (!method_exists($field, 'getAssets')) {
                  continue;
              }
  
              $assets = call_user_func([$field, 'getAssets']);
  
              $css->push(array_get($assets, 'css'));
              $js->push(array_get($assets, 'js'));
          }
  
          return static::$collectedAssets = [
              'css' => $css->flatten()->unique()->filter()->toArray(),
              'js' => $js->flatten()->unique()->filter()->toArray(),
          ];
      }
code: public static function collectFieldAssets()
      {
          if (!empty(static::$collectedAssets)) {
              return static::$collectedAssets;
          }
  
          $css = collect();
          $js = collect();
  
          foreach (static::$availableFields as $field) {
              if (!method_exists($field, 'getAssets')) {
                  continue;
              }
  
              $assets = call_user_func([$field, 'getAssets']);
  
              $css->push(array_get($assets, 'css'));
              $js->push(array_get($assets, 'js'));
          }
  
          return static::$collectedAssets = [
              'css' => $css->flatten()->unique()->filter()->toArray(),
              'js' => $js->flatten()->unique()->filter()->toArray(),
          ];
      }
code_tokens: public static function collectFieldAssets ( ) { if ( ! empty ( static :: $ collectedAssets ) ) { return static :: $ collectedAssets ; } $ css = collect ( ) ; $ js = collect ( ) ; foreach ( static :: $ availableFields as $ field ) { if ( ! method_exists ( $ field , 'getAssets' ) ) { continue ; } $ assets = call_user_func ( [ $ field , 'getAssets' ] ) ; $ css -> push ( array_get ( $ assets , 'css' ) ) ; $ js -> push ( array_get ( $ assets , 'js' ) ) ; } return static :: $ collectedAssets = [ 'css' => $ css -> flatten ( ) -> unique ( ) -> filter ( ) -> toArray ( ) , 'js' => $ js -> flatten ( ) -> unique ( ) -> filter ( ) -> toArray ( ) , ] ; }
docstring: Collect assets required by registered field.
  
  @return array
docstring_tokens: Collect assets required by registered field .