first commit

This commit is contained in:
2025-09-12 15:23:08 +08:00
commit a80c237bbb
117 changed files with 15628 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
<?php
namespace App\Model\Meta;
use Hyperf\Codec\Json;
use Hyperf\Contract\CastsAttributes;
class MetaCast implements CastsAttributes
{
/**
* @param $model
* @param string $key
* @param $value
* @param array $attributes
* @return AdminUserMeta
*/
public function get($model, string $key, $value, array $attributes): AdminUserMeta
{
return new AdminUserMeta(empty($value) ? [] : Json::decode($value));
}
/**
* @param $model
* @param string $key
* @param $value
* @param array $attributes
* @return array|string
*/
public function set($model, string $key, $value, array $attributes): array|string
{
return Json::encode($value);
}
}