Skip to content

Commit

Permalink
Merge branch 'master' into v4
Browse files Browse the repository at this point in the history
# Conflicts:
#	CHANGELOG.md
#	src/Extracting/Strategies/ResponseFields/GetFromResponseFieldTag.php
#	src/Tools/Globals.php
#	src/Writing/Writer.php
  • Loading branch information
shalvah committed Aug 12, 2022
2 parents a821f37 + a739d24 commit 895ae58
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Parameter data from successive stages is now merged
- Basic support for overriding docs for inherited methods ([9735fdf](9735fdf150469f186bab395fcfabd042f570c50c))

## 3.36.0 (12 August 2022)
### Modified
- Support `@responseField` on Eloquent API resources ([#505](https://github.com/knuckleswtf/scribe/pull/505))

## 3.35.0 (27 July 2022)
### Modified
- Use correct folders when generating in multi-docs ([ac47c67](https://github.com/knuckleswtf/scribe/commit/ac47c67eeb5d47cd30db74302d1cdd97720dd695))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,22 @@ protected function parseTag(string $tagContent): array

return $data;
}

/**
* Get api resource tag.
*
* @param Tag[] $tags
*
* @return Tag|null
*/
public function getApiResourceTag(array $tags): ?Tag
{
$apiResourceTags = array_values(
array_filter($tags, function ($tag) {
return ($tag instanceof Tag) && in_array(strtolower($tag->getName()), ['apiresource', 'apiresourcecollection']);
})
);

return empty($apiResourceTags) ? null : $apiResourceTags[0];
}
}
2 changes: 1 addition & 1 deletion src/Writing/Writer.php
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ protected function getLaravelTypeOutputPath(): ?string
{
if ($this->isStatic) return null;

return config('view.paths.0', "resources/views")."/$this->docsName";
return config('view.paths.0', function_exists('base_path') ? base_path("resources/views") : "resources/views")."/$this->docsName";
}

}

0 comments on commit 895ae58

Please sign in to comment.