code: private function filterCommands(Collection $commands, $type)
      {
          $baseCommandName = 'make:json-api:';
          $filterValues = explode(',', $this->option($type));
  
          $targetCommands = collect($filterValues)
              ->map(function ($target) use ($baseCommandName) {
                  return $baseCommandName . strtolower(trim($target));
              });
  
          return $commands->{$type}($targetCommands->toArray());
      }
docs: Filters out commands using either 'except' or 'only' filter.
  
  @param Collection $commands
  @param string $type
  @return Collection