If you use Models (not DB) you can create global/scopes and relations. As for DB there's no easy helper like that AFAIK. What you could do is create a function that takes care of this once for you. Like so:
protected function dbQuery($table_name)
{
return DB::table($table_name)
->join(...) //I want reuse this join
->join(...) //I want reuse this join
->join(...); //I want reuse this join
}
public function someQuery()
{
return $this->dbQuery('some_table')
->select(...)
->where(...)
->groupBy(...)
->get();
}
public function someOtherQuery()
{
return $this->dbQuery('some_table')
->where(...)
->count(...);
}