1 | <?php |
||
16 | class Video extends Model |
||
17 | { |
||
18 | /** |
||
19 | * The attributes that are mass assignable. |
||
20 | * |
||
21 | * @var array |
||
22 | */ |
||
23 | protected $fillable = ['name', 'category', 'path', 'user_id']; |
||
24 | |||
25 | /** |
||
26 | * The attributes that should be hidden for arrays. |
||
27 | * |
||
28 | * @var array |
||
29 | */ |
||
30 | protected $hidden = []; |
||
31 | |||
32 | /** |
||
33 | * Get User. |
||
34 | * |
||
35 | * @return \Illuminate\Database\Eloquent\Relations\BelongsTo |
||
36 | */ |
||
37 | public function getUser() |
||
41 | |||
42 | /** |
||
43 | * Get likes/Dislikes. |
||
44 | * |
||
45 | * @return \Illuminate\Database\Eloquent\Relations\HasMany |
||
46 | */ |
||
47 | public function getLikesDislikes() |
||
51 | |||
52 | /** |
||
53 | * Call scope likes. |
||
54 | * |
||
55 | * @return mixed |
||
56 | */ |
||
57 | 8 | public function likes() |
|
61 | |||
62 | /** |
||
63 | * Call scope dislikes. |
||
64 | * |
||
65 | * @return mixed |
||
66 | */ |
||
67 | 8 | public function dislikes() |
|
71 | |||
72 | /** |
||
73 | * Get comments. |
||
74 | * |
||
75 | * @return \Illuminate\Database\Eloquent\Relations\HasMany |
||
76 | */ |
||
77 | 8 | public function getComments() |
|
81 | } |
||
82 |