Package Data | |
---|---|
Maintainer Username: | limenet |
Maintainer Contact: | hi@linusmetzler.me (Linus Metzler) |
Package Create Date: | 2017-05-03 |
Package Last Update: | 2025-02-03 |
Home Page: | |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2025-02-09 15:21:00 |
Package Statistics | |
---|---|
Total Downloads: | 1,390 |
Monthly Downloads: | 3 |
Daily Downloads: | 0 |
Total Stars: | 0 |
Total Watchers: | 4 |
Total Forks: | 0 |
Total Open Issues: | 0 |
Set a datetime
attribute separately using a date
and a time
. This is especially helpful for input[type=date]
and input[type=time]
<?php
use Illuminate\Database\Eloquent\Model as Base;
use limenet\Laravel\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);
}
}