File tree Expand file tree Collapse file tree 1 file changed +25
-3
lines changed Expand file tree Collapse file tree 1 file changed +25
-3
lines changed Original file line number Diff line number Diff line change 33namespace BlameButton \Laravel \Changelog ;
44
55use BlameButton \Laravel \Changelog \Exceptions \ChangelogNotFoundException ;
6- use Illuminate \Support \Facades \Storage ;
6+ use Illuminate \Mail \Markdown ;
7+ use Illuminate \Support \HtmlString ;
78
89class Changelog
910{
11+ /**
12+ * Get the location of the changelog file.
13+ *
14+ * @return string
15+ */
1016 private function getFile (): string
1117 {
1218 return config ('changelog.file ' , base_path ('CHANGELOG.md ' ));
1319 }
1420
21+ /**
22+ * Get the raw content of the changelog.
23+ *
24+ * @return string
25+ * @throws ChangelogNotFoundException when the changelog file can not be found.
26+ */
1527 public function raw (): string
1628 {
1729 $ file = $ this ->getFile ();
1830
19- if (! Storage:: exists ($ file )) {
31+ if (!file_exists ($ file )) {
2032 throw new ChangelogNotFoundException ();
2133 }
2234
23- return Storage::get ($ file );
35+ return file_get_contents ($ file );
36+ }
37+
38+ /**
39+ * Generate a HTML version of your changelog.
40+ *
41+ * @return HtmlString
42+ */
43+ public function html (): HtmlString
44+ {
45+ return Markdown::parse ($ this ->raw ());
2446 }
2547}
You can’t perform that action at this time.
0 commit comments