From 68222ae1b9d774519ff5bf90ff3bfb9d29d6b7bd Mon Sep 17 00:00:00 2001 From: Jordan Hall Date: Wed, 17 Oct 2018 14:04:42 +0100 Subject: [PATCH] Method to get available relationships --- src/Apps/PrivateXeroApp.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/Apps/PrivateXeroApp.php b/src/Apps/PrivateXeroApp.php index 5bff1b4..39627d2 100644 --- a/src/Apps/PrivateXeroApp.php +++ b/src/Apps/PrivateXeroApp.php @@ -41,6 +41,18 @@ public function __construct($config) $this->populateRelationshipToModelMap('PayrollUS', 'payrollUS'); } + /** + * Retrieve a collection of the available relationships. + * + * @return \Illuminate\Support\Collection + */ + public function getAvailableRelationships() + { + $relationships = array_keys($this->relationshipToModelMap); + sort($relationships); + return collect($relationships); + } + /** * Populate the relationship to model map, for all models within * a specified model subdirectory.