-
-
Notifications
You must be signed in to change notification settings - Fork 364
/
Comment.php
executable file
·65 lines (57 loc) · 1.16 KB
/
Comment.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php
/**
* NOTICE OF LICENSE
*
* UNIT3D is open-sourced software licensed under the GNU General Public License v3.0
* The details is bundled with this project in the file LICENSE.txt.
*
* @project UNIT3D
* @license https://choosealicense.com/licenses/gpl-3.0/ GNU General Public License v3.0
* @author HDVinnie
*/
namespace App;
use Illuminate\Database\Eloquent\Model;
use App\Helpers\Bbcode;
class Comment extends Model
{
/**
* Belongs to Torrent
*
*/
public function torrent()
{
return $this->belongsTo(\App\Torrent::class);
}
/**
* Belongs to Article
*
*/
public function article()
{
return $this->belongsTo(\App\Article::class);
}
/**
* Belongs to Request
*
*/
public function request()
{
return $this->belongsTo(\App\Requests::class);
}
/**
* Belongs to User
*
*/
public function user()
{
return $this->belongsTo(\App\User::class);
}
/**
* Parse content and return valid HTML
*
*/
public function getContentHtml()
{
return Bbcode::parse($this->content);
}
}