1
1
<?php
2
2
namespace Lio \Forum \Replies ;
3
3
4
- use App ;
5
4
use Input ;
6
5
use McCool \LaravelAutoPresenter \BasePresenter ;
6
+ use Misd \Linkify \Linkify ;
7
7
use Request ;
8
8
9
9
class ReplyPresenter extends BasePresenter
10
10
{
11
11
public function url ()
12
12
{
13
- $ slug = $ this ->thread ->slug ;
14
- $ threadUrl = action ('Forum\ForumThreadsController@getShowThread ' , [$ slug ]);
15
- return $ threadUrl . \App::make ('Lio\Forum\Replies\ReplyQueryStringGenerator ' )->generate ($ this ->getWrappedObject ());
13
+ $ slug = $ this ->getWrappedObject ()->thread ->slug ;
14
+ $ threadUrl = action ('Forum\ForumThreadsController@getShowThread ' , $ slug );
15
+
16
+ return $ threadUrl . app (ReplyQueryStringGenerator::class)->generate ($ this ->getWrappedObject ());
16
17
}
17
18
18
19
public function created_ago ()
@@ -35,21 +36,20 @@ public function body()
35
36
return $ body ;
36
37
}
37
38
38
- // ------------------- //
39
-
40
39
private function convertMarkdown ($ content )
41
40
{
42
- return App:: make ('Lio\Markdown\HtmlMarkdownConvertor ' )->convertMarkdownToHtml ($ content );
41
+ return app ('Lio\Markdown\HtmlMarkdownConvertor ' )->convertMarkdownToHtml ($ content );
43
42
}
44
43
45
44
private function formatGists ($ content )
46
45
{
47
- return App:: make ('Lio\Github\GistEmbedFormatter ' )->format ($ content );
46
+ return app ('Lio\Github\GistEmbedFormatter ' )->format ($ content );
48
47
}
49
48
50
49
private function linkify ($ content )
51
50
{
52
- $ linkify = new \Misd \Linkify \Linkify ();
51
+ $ linkify = new Linkify ();
52
+
53
53
return $ linkify ->process ($ content );
54
54
}
55
55
}
0 commit comments