From cc44a3e2a20e122a3392e37d5dde161ce85aa35a Mon Sep 17 00:00:00 2001 From: Michael Bladowski Date: Wed, 28 Dec 2016 00:54:28 +0100 Subject: [PATCH 1/3] add hostname to output fix https://github.com/dingo/blueprint/issues/17 --- src/Blueprint.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Blueprint.php b/src/Blueprint.php index b95a66e..fa545e8 100644 --- a/src/Blueprint.php +++ b/src/Blueprint.php @@ -131,6 +131,8 @@ protected function generateContentsFromResources(Collection $resources, $name) $contents = ''; $contents .= $this->getFormat(); + $contents .= $this->line(1); + $contents .= 'HOST: ' . \Config::get('api.protocol') . '://' . \Config::get('api.domain') . '/' . \Config::get('api.prefix'); $contents .= $this->line(2); $contents .= sprintf('# %s', $name); $contents .= $this->line(2); From c7c8cd41209dd71712af1c038d96a2f602b61729 Mon Sep 17 00:00:00 2001 From: Michael Bladowski Date: Wed, 28 Dec 2016 01:07:17 +0100 Subject: [PATCH 2/3] check class \Config exists thanks travis ;) --- src/Blueprint.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Blueprint.php b/src/Blueprint.php index fa545e8..e6a3a68 100644 --- a/src/Blueprint.php +++ b/src/Blueprint.php @@ -132,7 +132,7 @@ protected function generateContentsFromResources(Collection $resources, $name) $contents .= $this->getFormat(); $contents .= $this->line(1); - $contents .= 'HOST: ' . \Config::get('api.protocol') . '://' . \Config::get('api.domain') . '/' . \Config::get('api.prefix'); + if (class_exists('\Illuminate\Config\Repository')) $contents .= 'HOST: ' . \Config::get('api.protocol') . '://' . \Config::get('api.domain') . '/' . \Config::get('api.prefix'); $contents .= $this->line(2); $contents .= sprintf('# %s', $name); $contents .= $this->line(2); From a4c775048b137f76c9403f5ec797d198338ee239 Mon Sep 17 00:00:00 2001 From: Michael Bladowski Date: Wed, 28 Dec 2016 01:13:10 +0100 Subject: [PATCH 3/3] should fix tests --- src/Blueprint.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Blueprint.php b/src/Blueprint.php index e6a3a68..829349e 100644 --- a/src/Blueprint.php +++ b/src/Blueprint.php @@ -131,8 +131,10 @@ protected function generateContentsFromResources(Collection $resources, $name) $contents = ''; $contents .= $this->getFormat(); - $contents .= $this->line(1); - if (class_exists('\Illuminate\Config\Repository')) $contents .= 'HOST: ' . \Config::get('api.protocol') . '://' . \Config::get('api.domain') . '/' . \Config::get('api.prefix'); + if (class_exists('\Illuminate\Config\Repository')) { + $contents .= $this->line(1); + $contents .= 'HOST: ' . \Config::get('api.protocol') . '://' . \Config::get('api.domain') . '/' . \Config::get('api.prefix'); + } $contents .= $this->line(2); $contents .= sprintf('# %s', $name); $contents .= $this->line(2);