I need to do two joins with the same table, I have tried to assign an alias to each table as shown in the code but it is not possible I get an error. How can I add an alias to each table?
$this->src("mysql")->query(MySQL::type( DB::table('cuenta_cobrar')
->join('vendedor as v1', 'cuenta_cobrar.vendedor', '=', 'v1.id')
->join('vendedor as v2', 'cuenta_cobrar.recaudador', '=', 'v2.id'))
->select('v1.nombre')->alias('VENDEDOR')
->select('v2.nombre')->alias('RECAUDADOR'))
->pipe($this->dataStore("datos"));