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].
1,396
Install
composer require limenet/laravel-datetime-attributes
Latest Version:v1.2.0
PHP:^8.3
Laravel:12 · 13
Older releases:5 – 11
License:MIT
Last Updated:Jun 24, 2026
Links: GitHub  ·  Packagist
Maintainer: limenet

Laravel Datetime Attributes

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

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);
    }
}

Related Packages

doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

644,549,754 9,698
laravel/framework

The Laravel Framework.

593,882,149 34,959
laravel/tinker

Powerful REPL for the Laravel framework.

507,193,856 7,441
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

423,477,751 607
nunomaduro/collision

Cli error handling for console/command-line PHP applications.

399,241,428 4,660

Version History

Version Released PHP Laravel License
v1.2.0 ^8.3 ^12.0 || ^13.0 MIT
v1.1.0 ^8.1 ^10.0 || ^11.0 MIT
v1.0.0 ^8.1 ^10.0 || ^11.0 MIT
v0.3.0 ^8.1 ^10.0 MIT
v0.2.3 ^8.0 ^9.0 || ^10.0 MIT