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 3
3
namespace BlameButton \Laravel \Changelog ;
4
4
5
5
use BlameButton \Laravel \Changelog \Exceptions \ChangelogNotFoundException ;
6
- use Illuminate \Support \Facades \Storage ;
6
+ use Illuminate \Mail \Markdown ;
7
+ use Illuminate \Support \HtmlString ;
7
8
8
9
class Changelog
9
10
{
11
+ /**
12
+ * Get the location of the changelog file.
13
+ *
14
+ * @return string
15
+ */
10
16
private function getFile (): string
11
17
{
12
18
return config ('changelog.file ' , base_path ('CHANGELOG.md ' ));
13
19
}
14
20
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
+ */
15
27
public function raw (): string
16
28
{
17
29
$ file = $ this ->getFile ();
18
30
19
- if (! Storage:: exists ($ file )) {
31
+ if (!file_exists ($ file )) {
20
32
throw new ChangelogNotFoundException ();
21
33
}
22
34
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 ());
24
46
}
25
47
}
You can’t perform that action at this time.
0 commit comments