limenet/laravel-datetime-attributes
Composer 安装命令:
composer require limenet/laravel-datetime-attributes
包简介
Set a datetime attribute separately using a date and a time. This is especially helpful for input[type=date] and input[type=time].
README 文档
README
Set a datetime attribute separately using a date and a time. This is especially helpful for input[type=date] and input[type=time]
Usage
<?php use Illuminate\Database\Eloquent\Model as Base; use Limenet\LaravelDatetimeAttributes\DateTimeTrait; class Model extends Base { use DateTimeTrait; public function getStartDateAttribute() { return $this->dtGetDate('start'); } public function getStartTimeAttribute() { return $this->dtGetTime('start'); } public function setStartDateAttribute($value) { $this->dtSetDate('start', $value); } public function setStartTimeAttribute($value) { $this->dtSetTime('start', $value); } }
统计信息
- 总下载量: 1.4k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-05-03