for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Equip\Data\Traits;
use Carbon\Carbon;
trait DateAwareTrait
{
/**
* Get a date object for a property
*
* @param string $key
* @return Carbon
*/
public function date($key)
return new Carbon($this->$key);
}
* Get a storage-friendly date string for a property
* @return string
public function dateString($key)
return $this->date($key)->format('r');