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].
Package info
github.com/limenet/laravel-datetime-attributes
pkg:composer/limenet/laravel-datetime-attributes
v1.2.0
2026-03-30 16:30 UTC
Requires
- php: ^8.3
- illuminate/database: ^12.0 || ^13.0
- nesbot/carbon: ^3.0
- spatie/laravel-package-tools: ^1.14.0
Requires (Dev)
- larastan/larastan: ^3.9.3
- laravel/pint: ^1.29.0
- nunomaduro/collision: ^7.0 || ^8.9.1
- orchestra/testbench: ^10.10 || ^11.0
- phpstan/extension-installer: ^1.4.3
- phpstan/phpstan-deprecation-rules: ^2.0.4
- phpstan/phpstan-phpunit: ^2.0.16
- phpstan/phpstan-strict-rules: ^2.0.10
- phpunit/phpunit: ^10.5.27 || ^11.5.55
- rector/rector: ^2.3.9
This package is auto-updated.
Last update: 2026-03-30 19:25:39 UTC
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); } }