/** * Get the owner for this property. */ public function owner() { $foreignKey = 'strIDNumber'; $localKey = 'strIdentity'; $instance = new Owner(); $instance->setConnection($this->getConnectionName()); return new HasOne($instance->newQuery(), $this, $foreignKey, $localKey); // return $this->hasOne('App\Owner','strIDNumber' ,'strIdentity' ); }