public function links($class = null)
    {
        if (is_null($class)) {
            $class = '';
        }

        $dateArray = explode('-', $this->date);
        $previousMonth = Carbon::create($dateArray[0], $dateArray[1], $dateArray[2])->subMonth()->toDateString();
        $nextMonth = Carbon::create($dateArray[0], $dateArray[1], $dateArray[2])->addMonth()->toDateString();

        $links = '<div class="row calendar-links"><div class="col-12">';
        $links .= '<a class="previous '.$class.'" href="'.url('events/'.$previousMonth).'">Previous Month</a>';
        $links .= '<a class="next '.$class.'" href="'.url('events/'.$nextMonth).'">Next Month</a>';
        $links .= '</div></div>';

        return $links;
    }
public function links($class = null)
    {
        if (is_null($class)) {
            $class = '';
        }

        $dateArray = explode('-', $this->date);
        $previousMonth = Carbon::create($dateArray[0], $dateArray[1], $dateArray[2])->subMonth()->toDateString();
        $nextMonth = Carbon::create($dateArray[0], $dateArray[1], $dateArray[2])->addMonth()->toDateString();

        $links = '<div class="row calendar-links"><div class="col-12">';
        $links .= '<a class="previous '.$class.'" href="'.url('events/'.$previousMonth).'">Previous Month</a>';
        $links .= '<a class="next '.$class.'" href="'.url('events/'.$nextMonth).'">Next Month</a>';
        $links .= '</div></div>';

        return $links;
    }
public function links ( $ class = null ) { if ( is_null ( $ class ) ) { $ class = '' ; } $ dateArray = explode ( '-' , $ this -> date ) ; $ previousMonth = Carbon :: create ( $ dateArray [ 0 ] , $ dateArray [ 1 ] , $ dateArray [ 2 ] ) -> subMonth ( ) -> toDateString ( ) ; $ nextMonth = Carbon :: create ( $ dateArray [ 0 ] , $ dateArray [ 1 ] , $ dateArray [ 2 ] ) -> addMonth ( ) -> toDateString ( ) ; $ links = '<div class="row calendar-links"><div class="col-12">' ; $ links .= '<a class="previous ' . $ class . '" href="' . url ( 'events/' . $ previousMonth ) . '">Previous Month</a>' ; $ links .= '<a class="next ' . $ class . '" href="' . url ( 'events/' . $ nextMonth ) . '">Next Month</a>' ; $ links .= '</div></div>' ; return $ links ; }
Generate HTML links

@param  string $class

@return string
Generate HTML links