-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create Twill v3 version of api model patch [WEB-2956]
- Loading branch information
1 parent
f674ac6
commit ad710ef
Showing
2 changed files
with
9 additions
and
9 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
diff --git a/src/Repositories/ModuleRepository.php b/src/Repositories/ModuleRepository.php | ||
index cb6986e0..bf268cc9 100644 | ||
index 47e56466..5172e25d 100644 | ||
--- a/src/Repositories/ModuleRepository.php | ||
+++ b/src/Repositories/ModuleRepository.php | ||
@@ -867,6 +867,8 @@ abstract class ModuleRepository | ||
if (!$modelOrRepository) { | ||
if (class_exists($relation) && (new $relation) instanceof Model) { | ||
$modelOrRepository = str_after_last($relation, '\\'); | ||
+ } elseif (class_exists($relation) && (new $relation) instanceof \App\Libraries\Api\Models\BaseApiModel) { | ||
+ $modelOrRepository = 'Api\\' .str_after_last($relation, '\\'); | ||
@@ -696,6 +696,8 @@ abstract class ModuleRepository | ||
if (! $modelOrRepository) { | ||
if (class_exists($relation) && (new $relation()) instanceof Model) { | ||
$modelOrRepository = Str::afterLast($relation, '\\'); | ||
+ } elseif (class_exists($relation) && (new $relation()) instanceof \App\Libraries\Api\Models\BaseApiModel) { | ||
+ $modelOrRepository = 'Api\\' . Str::afterLast($relation, '\\'); | ||
} else { | ||
$morphedModel = Relation::getMorphedModel($relation); | ||
if (class_exists($morphedModel) && (new $morphedModel) instanceof Model) { | ||
if (class_exists($morphedModel) && (new $morphedModel()) instanceof Model) { |