protected function needsNewVersion($entity) {
        if(!$entity->isHead()) {
            return false;
        }

        if(!$entity->hasVersions()) {
            return true;
        }

        $oldTimestamp = $entity->getVersions()->first()->getUpdatedAt();
        $newTimestamp = Carbon::now();
        $diff = $newTimestamp->diffInHours($oldTimestamp);

        if($diff >= 24) {
            return true;
        }
    }
protected function needsNewVersion($entity) {
        if(!$entity->isHead()) {
            return false;
        }

        if(!$entity->hasVersions()) {
            return true;
        }

        $oldTimestamp = $entity->getVersions()->first()->getUpdatedAt();
        $newTimestamp = Carbon::now();
        $diff = $newTimestamp->diffInHours($oldTimestamp);

        if($diff >= 24) {
            return true;
        }
    }
protected function needsNewVersion ( $ entity ) { if ( ! $ entity -> isHead ( ) ) { return false ; } if ( ! $ entity -> hasVersions ( ) ) { return true ; } $ oldTimestamp = $ entity -> getVersions ( ) -> first ( ) -> getUpdatedAt ( ) ; $ newTimestamp = Carbon :: now ( ) ; $ diff = $ newTimestamp -> diffInHours ( $ oldTimestamp ) ; if ( $ diff >= 24 ) { return true ; } }
Determines if the entity needs a new version created.

@param $entity
@return boolean
Determines if the entity needs a new version created .