bbprojectnet/laravel-casts 问题修复 & 功能扩展

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

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

bbprojectnet/laravel-casts

最新稳定版本:1.3.0

Composer 安装命令:

composer require bbprojectnet/laravel-casts

包简介

Additional casts classes for Laravel.

README 文档

README

This package provides some additional castable classes for Laravel.

Requirements

  • PHP 8.1 and above
  • Laravel 9, 10, 11 or 12

Installation

Require this package with composer using the following command:

composer require bbprojectnet/laravel-casts

Casts

AsEnumArray

Casts a value (json) to a array of Enums.

protected $casts = [ 'roles' => AsEnumArray::class . ':' . Role::class, ];

AsEnumCollection

Casts a value (json) to a Laravel Collection of Enums.

protected $casts = [ 'roles' => AsEnumCollection::class . ':' . Role::class, ];

AsHash

Saves the value as a hash using the Laravel Hash facade. As of Laravel 10, same as hashed cast.

protected $casts = [ 'password' => AsHash::class, ];

AsInterval

Casts a seconds value (integer) as a CarbonInterval class.

protected $casts = [ 'timeout' => AsInterval::class, ];

AsStrictArray

Same as array, except that a null value is cast to an empty array. Similarly, an empty array is stored in the database as null.

protected $casts = [ 'items' => AsStrictArray::class, ];

AsTimeZone

Cast a value (string) as a DateTimeZone class.

protected $casts = [ 'timezone' => AsTimeZone::class, ];

License

The Laravel casts package is open-sourced software licensed under the MIT license.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固