ModelStub::getAgeAttribute PHP 메소드

getAgeAttribute() 공개 메소드

public getAgeAttribute ( $value )
    public function getAgeAttribute($value)
    {
        $date = DateTime::createFromFormat('U', $this->attributes['birthday']);
        return $date->diff(new DateTime('now'))->y;
    }