use DB;
class A extends \Illuminate\Database\Eloquent\Model;
{
use \Awobaz\Compoships\Compoships;
public function b()
{
return $this->hasMany('B',
['foreignKey1', DB::raw('C.foreignKey2')], //can be more raws
['localKey1', 'localKey2']
)
->join('C','C.other_key','=','B.other_key');
}
}
Actual results:
(`B`.`foreignKey1`= 1 and B.C.foreignKey2 = 2)
Expected results:
(`B`.`foreignKey1`= 1 and C.foreignKey2 = 2)
maybe we can have more options with DB::raw() example
Closes #121 Let raw expresions be foreign keys
Example:
Actual results:
Expected results:
maybe we can have more options with
DB::raw()
exampleresults on
@topclaudy