public function lastReply()
    {
        try {
            $replies = ForumReply::where('post_id', $this->id)->get();

            if ($replies->isEmpty()) {
                return null;
            }

            $reply = $replies->last();

            return [
                'author' => $reply->author->name,
                'date' => $reply->created_at
            ];
        } catch (Exception $e) {
            return null;
        }
    }
public function lastReply()
    {
        try {
            $replies = ForumReply::where('post_id', $this->id)->get();

            if ($replies->isEmpty()) {
                return null;
            }

            $reply = $replies->last();

            return [
                'author' => $reply->author->name,
                'date' => $reply->created_at
            ];
        } catch (Exception $e) {
            return null;
        }
    }
public function lastReply ( ) { try { $ replies = ForumReply :: where ( 'post_id' , $ this -> id ) -> get ( ) ; if ( $ replies -> isEmpty ( ) ) { return null ; } $ reply = $ replies -> last ( ) ; return [ 'author' => $ reply -> author -> name , 'date' => $ reply -> created_at ] ; } catch ( Exception $ e ) { return null ; } }
Gets the last reply for the current forum post.

@return array
Gets the last reply for the current forum post .