v0.1.0
This commit is contained in:
13
provm/common/Define/Model/Date.php
Normal file
13
provm/common/Define/Model/Date.php
Normal file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
namespace ProVM\Common\Define\Model;
|
||||
|
||||
use Carbon\Carbon;
|
||||
|
||||
trait Date {
|
||||
public function date(\DateTime $date = null) {
|
||||
if ($date === null) {
|
||||
return Carbon::parse($this->date);
|
||||
}
|
||||
$this->date = $date->format('Y-m-d');
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user