Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Supports Laravel Package

yansongda/supports

Supports is a small PHP utility library from the yansongda ecosystem that simplifies working with arrays, configuration, and pipelines. It provides handy helpers for array access and manipulation, config handling, and pipeline processing, making it useful for Laravel or PHP projects that need lightw...

View on GitHub
Deep Wiki
Context7
v4.1.3

[v4.1.3] - 2026-10-10

Added

  • 新增 Yansongda\Supports\Json 工具类:Json::encode()/Json::decode() 薄封装原生 json_encode()/json_decode(),失败即抛 \JsonException(code 为 JSON_ERROR_*),不再需要靠 false 返回值或 json_last_error() 判断失败 (#42)
    • Json::encode(mixed $value, int $flags = JSON_UNESCAPED_UNICODE, int $depth = 512): string

    • Json::decode(string $json, bool $assoc = true, int $depth = 512, int $flags = 0): mixed(默认返回关联数组)

    • encode() 默认 flags 为 JSON_UNESCAPED_UNICODE(原生为 0,中文会被转义为 \uXXXX),传 0 可还原原生转义行为;$flags/$depth 参数名对齐原生函数,其余行为与原生一致

    • 使用示例(运行环境要求不变,仍为 PHP >= 8.2):

      use Yansongda\Supports\Json;
      
      Json::encode(['name' => '中文']);  // {"name":"中文"}
      Json::decode('{"name":"中文"}');   // ['name' => '中文']
      Json::decode('{bad');             // 抛 \JsonException,原生此处返回 null
      
v4.1.2

[v4.1.2] - 2026-09-09

Added

  • composer.json 显式声明 ext-simplexml 与 ext-libxml 依赖(Collection::toXml()/Arr::wrapXml() 实际所需,此前未显式声明)
  • 新增 Collection::toQueryString() 方法:查询串构造(等价原 toString() 能力,Arr::toString() 静态方法不变)

Changed

  • Collection::toString() 标记 [@deprecated](https://github.com/deprecated)(phpdoc + PHP 8 原生 #[\Deprecated] 注解,PHP 8.4+ 调用时自动触发 deprecation 提示):继续可用,实现改为委托新增的 toQueryString(),行为不变;将在后续大版本移除,建议迁移
  • Arr::sortRecursive() 内部实现由引用遍历改写为键位赋值形态,Arr::shuffle()/Collection::valueRetriever() 内部回调闭包签名补全:均为内部实现优化,签名与可观察行为不变
  • Collection::except() 改为变参签名(mixed ...$keys):主用形态行为不变,仅 except(['a'], ['b']) 由旧静默丢弃多余实参改为执行期 TypeError
  • Pipeline::through() 改为变参签名(mixed ...$pipes):主用形态行为不变,仅 through(['a'], 'b') 由旧静默丢弃改为执行期 TypeError;through([$obj, 'method']) 语义由"对象 + 字符串两管道"修正为"单个 callable-array 管道"(与 illuminate 主流用法一致)

Fixed

  • Str::ascii()/Str::slug()/Str::kebab() 在 strict_types=1 下对任意输入必抛 TypeError 的 bug(charsArray() 数字字符串键被 PHP 规范化为 int 键,str_replace() 收到 int 抛错)
v2.2.0
  • add: 2.x 支持guzzle7
v3.0.1
  • add logger class consturct
v3.0.0
  • upgrade php to 7.2
  • upgrade monlog to 2.0
  • upgrade guzzle to 7.0
  • remove log class
v1.6.1
  • 命名更改:connect_timeout 更改为 connectTimeout
v1.1.0

增加 guzzle 依赖,增加 HasHttpRequest Trait

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
rlacerda83/query-parser
socialdept/atp-orm
cboxdk/laravel-assistant-client
socialdept/atp-resolver
socialdept/tenant-domains
tautvydasr/blade-class-names
socialdept/color-scales
maherelgamil/controller
coleus/widgets
coleus/table
coleus/users
coleus/music
coleus/health
coleus/calendar
coleus/notes
coleus/support
coleus/settings
coleus/apps
seampact/laravel
emmyconceptng/laravel-ng-postcode