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
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

erirk/paypalpayment

laravel-paypalpayment is simple package help you process direct credit card paym...

0
gabrieloliverio/laravel5-generators

Database metadata-based generators for Laravel 5

1
doctrine/dbal

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

619,738,036 9,700
laravel/framework

The Laravel Framework.

561,395,438 34,860
laravel/tinker

Powerful REPL for the Laravel framework.

475,095,200 7,439