Skip to content

Commit

Permalink
area17#1573: Fix capsule access in modulerepository.
Browse files Browse the repository at this point in the history
  • Loading branch information
haringsrob committed Apr 8, 2022
1 parent b434909 commit 9535d82
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Repositories/ModuleRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -881,10 +881,10 @@ protected function getModelRepository($relation, $modelOrRepository = null)

if ($repository instanceof ModuleRepository) {
return $repository;
} else {
$class = Config::get('twill.namespace') . "\\Repositories\\" . ucfirst($modelOrRepository) . "Repository";
}

$class = Config::get('twill.namespace') . "\\Repositories\\" . ucfirst($modelOrRepository) . "Repository";

if (class_exists($class)) {
return App::make($class);
}
Expand All @@ -895,7 +895,7 @@ protected function getModelRepository($relation, $modelOrRepository = null)
throw new Exception("Repository class not found for model '{$modelOrRepository}'");
}

return App::make($capsule['repository']);
return App::make($capsule->getRepositoryClass());
}

/**
Expand Down

0 comments on commit 9535d82

Please sign in to comment.