protected function updatePublishedAt(Eloquent $content)
    {
        $start = new Carbon('0000-00-00 00:00:00');

        if ($content->getAttribute('status') !== Eloquent::STATUS_PUBLISH) {
            return false;
        }

        $published = $content->getAttribute('published_at');

        switch (true) {
            case is_null($published):
                # next;
            case $published->format('Y-m-d H:i:s') === '0000-00-00 00:00:00':
                # next;
            case $published->toDateTimeString() === $start->toDateTimeString():
                return true;
            default:
                return false;
        }
    }
protected function updatePublishedAt(Eloquent $content)
    {
        $start = new Carbon('0000-00-00 00:00:00');

        if ($content->getAttribute('status') !== Eloquent::STATUS_PUBLISH) {
            return false;
        }

        $published = $content->getAttribute('published_at');

        switch (true) {
            case is_null($published):
                # next;
            case $published->format('Y-m-d H:i:s') === '0000-00-00 00:00:00':
                # next;
            case $published->toDateTimeString() === $start->toDateTimeString():
                return true;
            default:
                return false;
        }
    }
protected function updatePublishedAt ( Eloquent $ content ) { $ start = new Carbon ( '0000-00-00 00:00:00' ) ; if ( $ content -> getAttribute ( 'status' ) !== Eloquent :: STATUS_PUBLISH ) { return false ; } $ published = $ content -> getAttribute ( 'published_at' ) ; switch ( true ) { case is_null ( $ published ) : # next; case $ published -> format ( 'Y-m-d H:i:s' ) === '0000-00-00 00:00:00' : # next; case $ published -> toDateTimeString ( ) === $ start -> toDateTimeString ( ) : return true ; default : return false ; } }
Determine whether published_at should be updated.

@param  \Orchestra\Story\Model\Content  $content

@return bool
Determine whether published_at should be updated .