forked from gothinkster/realworld-starter-kit
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Comment.php
45 lines (37 loc) · 908 Bytes
/
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
<?php
namespace Conduit\Models;
use Illuminate\Database\Eloquent\Model;
/**
* @property integer id
* @property string body
* @property integer article_id
* @property integer user_id
* @property \Conduit\Models\User user
* @property \Conduit\Models\Article article
* @property \Carbon\Carbon created_at
* @property \Carbon\Carbon update_at
*/
class Comment extends Model
{
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'body',
'user_id',
'article_id',
];
/********************
* Relationships
********************/
public function article()
{
return $this->belongsTo(Article::class);
}
public function user()
{
return $this->belongsTo(User::class);
}
}