app\models\KudosuHistory::scopeWithPost PHP Method

scopeWithPost() public method

public scopeWithPost ( $query )
    public function scopeWithPost($query)
    {
        $postTableName = (new Forum\Post())->getTable();
        $thisTableName = $this->getTable();
        return $query->whereExists(function ($query) use($postTableName, $thisTableName) {
            $query->select(DB::raw(1))->from($postTableName)->whereRaw("{$postTableName}.post_id = {$thisTableName}.post_id");
        });
    }