Skip to content

Commit cf6c91e

Browse files
committed
fixes #77 and #78
1 parent e5c6b13 commit cf6c91e

File tree

1 file changed

+2
-17
lines changed

1 file changed

+2
-17
lines changed

src/Models/ForeignConstraint.php

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public function __construct($column, $references, $on, $onDelete = null, $onUpda
9292
public function getReferencesModel()
9393
{
9494
if (empty($this->referencesModel)) {
95-
$this->referencesModel = self::getModelNamespace(ucfirst($this->getForeignModelName()));
95+
$this->referencesModel = self::getModelNamespace($this->getForeignModelName(), null);
9696
}
9797

9898
return $this->referencesModel;
@@ -132,21 +132,6 @@ public function getForeignRelation()
132132
return $relation;
133133
}
134134

135-
/**
136-
* Get the namecpase of the foreign model.
137-
*
138-
* @param string $modelName
139-
*
140-
* @return string
141-
*/
142-
/*
143-
protected function getModelNamespace($modelName)
144-
{
145-
$path = Helpers::getAppNamespace() . rtrim(Config::getModelsPath(), '\\');
146-
147-
return $path . '\\' . $modelName;
148-
}
149-
*/
150135
/**
151136
* Get the name of the foreign model.
152137
*
@@ -156,7 +141,7 @@ protected function getModelNamespace($modelName)
156141
*/
157142
protected function getForeignModelName($prefix = '')
158143
{
159-
return camel_case($prefix . Str::singular($this->references));
144+
return ucfirst(camel_case($prefix . Str::singular($this->references)));
160145
}
161146

162147
/**

0 commit comments

Comments
 (0)