public function scopeLive($query)
	{
		return $query->where($this->getTable().'.status', '=', Post::APPROVED)
			->where($this->getTable().'.published_date', '<=', \Carbon\Carbon::now());
	}
public function scopeLive($query)
	{
		return $query->where($this->getTable().'.status', '=', Post::APPROVED)
			->where($this->getTable().'.published_date', '<=', \Carbon\Carbon::now());
	}
public function scopeLive ( $ query ) { return $ query -> where ( $ this -> getTable ( ) . '.status' , '=' , Post :: APPROVED ) -> where ( $ this -> getTable ( ) . '.published_date' , '<=' , \ Carbon \ Carbon :: now ( ) ) ; }
Query scope for "live" posts, adds conditions for status = APPROVED and published date is in the past

@param $query
@return mixed
Query scope for live posts adds conditions for status = APPROVED and published date is in the past