plumthedev/json-shape 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

plumthedev/json-shape

Composer 安装命令:

composer require plumthedev/json-shape

包简介

TBA

README 文档

README

Give JSON a shape — typed objects for your database JSON columns in Laravel.

A JSON column comes back from Eloquent as a plain array: no autocomplete, no static analysis, and a typo only blows up at runtime. JsonShape turns that array into a typed object you define once, while staying a thin wrapper you can still treat like an array.

class Example extends Model
{
    public function casts(): array
    {
        return ['trace' => AsJsonShape::of(TraceShape::class)];
    }
}

$example->trace->traceId;       // string, with autocomplete
$example->trace->getDuration(); // int
$example->save();               // encoded back to JSON

Installation

Requires PHP 8.4+ and Laravel 13.

composer require plumthedev/json-shape

Documentation

Full guides and examples live at plumthedev.github.io/json-shape:

Development

This project is developed entirely inside Docker, so the only tools you need on your machine are Docker (with the Compose plugin) and Make.

make composer install      # install dependencies
make code-style-check      # Pint (code style)
make phpstan               # PHPStan (static analysis)
make phpunit               # PHPUnit (tests)
make docs-preview          # preview the docs site locally

The default PHP version is 8.4; override it per command with PHP_VERSION (82, 83, 84), e.g. make phpunit PHP_VERSION=83.

License

Released under the MIT License.

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-06-21

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固