public function myhasOne($related, $foreignKey = null, $localKey = null, $table)
{
//$instance = $this->newRelatedInstance($related);
$instance = (new $related)->setTable($table);
$foreignKey = $foreignKey ?: $this->getForeignKey();
$localKey = $localKey ?: $this->getKeyName();
return $this->newHasOne($instance->newQuery(), $this, $instance->getTable().'.'.$foreignKey, $localKey);
}